Go to advanced search

by AnthonyPaulO
Mon Oct 30, 2017 5:38 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Are there any news? Since you use Ultibo (which appears to be a great one person show), what is your experience? There are a few bar metal approaches for the Pi, however, unlike them, Ultibo seems to provide some _real_ base to develop applications on bare metal. Hi! Well in my last post I describe...
by AnthonyPaulO
Sat Oct 07, 2017 12:26 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

I'm happy to report that I'm able to interface the Pi 3 with the Apple II at 1mhz via an 8-bit uni-directional GPIO bus via bit-banging. The test involved simulating an Apple II absolute LDA instruction to load data at an address (cycle accurate) and I was able to dump the ROM. Next step is to simul...
by AnthonyPaulO
Thu Sep 14, 2017 4:08 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

If the registers are next to each other then perhaps a 64-bit instruction could be used to access both at the same time; I believe the Armv8 allows this.
by AnthonyPaulO
Thu Sep 14, 2017 2:11 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Regarding DMA, do you feel that hzeller was wrong in his analysis of DMA <-> GPIO performance? He's been at this for a while so I never considered he might be wrong.

https://github.com/hzeller/rpi-gpio-dma-demo
by AnthonyPaulO
Thu Sep 14, 2017 2:02 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

what the heck is the Pi spending all its cycles on? After all, at 1.1ghz the Pi can perform 1100 instructions each 1us; I should have plenty of bandwidth to spare but that doesn't seem to be the case here I guess you confuse CPU clock and bus clock. It takes much (!) longer to query a peripheral th...
by AnthonyPaulO
Thu Sep 14, 2017 1:57 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Wow... I just made some measurements.

84ns to read GPIO register
84ns to read async rising edge event
22ns to clear event flag

Those are some pretty big numbers!
by AnthonyPaulO
Wed Sep 13, 2017 9:02 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Well, if I understand you correctly, you want to sample an incoming signal at one bus-cycle, process it, and put the resulting data on the bus in the next cycle? Is that what you want to do? I assumed you would process data in blocks. You never answered my question to sketch out a dialogue on the b...
by AnthonyPaulO
Wed Sep 13, 2017 2:18 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

I don't know what you mean. Are you implying that the sampling rate drops when the levels at the pins change? Are you implying that a changed value at the pin takes a 1us or beyond to be reflected in the level register. Can you back that up? When I connected two 7 bit counters at a high clock speed...
by AnthonyPaulO
Tue Sep 12, 2017 9:07 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Seriously though, I'm not being sarcastic... if anyone has any information on receiving or sending data at higher speeds please post it here; I'm looking to push the envelope as far as possible and I don't care if someone else has done it already, I just want to achieve as high a speed as possible.
by AnthonyPaulO
Tue Sep 12, 2017 8:59 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

He can sample the Level register all he wants, but unless it actually contains data it's useless. I would love to see if he can achieve those rates with, say, a teensy feeding data to the Pi via GPIO at Mhz speeds. I find that as soon as those pins start dancing your sampling rate goes down consider...
by AnthonyPaulO
Tue Sep 12, 2017 8:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

For pacing I read the rising and falling edge events; two of them count as one cycle, then I keep going until a certain number of iterations. I then calculate the sampling rate based on how long it spent in real-time and how many cycles it completed.
by AnthonyPaulO
Tue Sep 12, 2017 8:44 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

At first I got really excited when I saw your pdf documenting much higher speeds, but then I read the not-so-fine-print : This project tries to determine the maximum I/O throughput for the Raspberry Pi in order to estimate its fitness for data sampling. The maximum I/O throughput should be considere...
by AnthonyPaulO
Tue Sep 12, 2017 6:48 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Okay, after a lot of experimentation and testing I've managed to confirm that I can reliably read an incoming 1mhz signal using a Pi 3 via GPIO; however, it seems that is pretty much the limit of what can be done here since you don't have a lot of bandwidth left to respond to it, so as long as your ...
by AnthonyPaulO
Tue Sep 12, 2017 4:49 am
Forum: Troubleshooting
Topic: Async Rising/Falling Edge hanging on 1mhz signal
Replies: 6
Views: 1232

Re: Async Rising/Falling Edge hanging on 1mhz signal

Okay, turns out it was freezing due to interrupts being enabled by default; turning them off made the freezing go away.
by AnthonyPaulO
Mon Sep 11, 2017 3:07 pm
Forum: Troubleshooting
Topic: Async Rising/Falling Edge hanging on 1mhz signal
Replies: 6
Views: 1232

Re: Async Rising/Falling Edge hanging on 1mhz signal

Good question, I'll generate a lower frequency and see what happens but I'm sure something that low will be okay. I'm on bare metal btw (Ultibo), no os and I don't want interrupts enabled at all so if interrupts are enabled by default then I can see that being the reason for the hanging, but if inte...
by AnthonyPaulO
Mon Sep 11, 2017 11:49 am
Forum: Troubleshooting
Topic: Async Rising/Falling Edge hanging on 1mhz signal
Replies: 6
Views: 1232

Re: Async Rising/Falling Edge hanging on 1mhz signal

I'm using the Pi 3 so there's still issues. If this is indeed an interrupt issue then GPIO interrupts are enabled by default; can anyone confirm this? Also, if this is the case, is there a way to disable this?
by AnthonyPaulO
Mon Sep 11, 2017 3:51 am
Forum: Troubleshooting
Topic: Async Rising/Falling Edge hanging on 1mhz signal
Replies: 6
Views: 1232

Async Rising/Falling Edge hanging on 1mhz signal

Does anyone know the frequency limit for the Async Edge detection logic? I attached a 1mhz square wave generator to a pin and as soon as i set it for async edge detection it hangs my Pi 3.
by AnthonyPaulO
Thu Sep 07, 2017 12:40 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Unfortunately I was unable to get much done last night (my wife was chewing my ear out until 1am from the moment I stepped in the door) but I did measure the 1mhz clock frequency after the 100K/200K resistors and the square wave looks like shark fins. Since the unofficial specs state that the most I...
by AnthonyPaulO
Wed Sep 06, 2017 2:26 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Okay, armed with a borrowed oscilloscope, a 3.3v arduino, and my good looks I generated a square wave from 1s down to 6us and the Pi was able to keep up. I checked the 1mhz clock and it seemed fine, connected the Pi to the clock and confirmed we have the same problem. I then swapped out the 1k/2k re...
by AnthonyPaulO
Tue Sep 05, 2017 6:05 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

I've put the pedal to the metal and have some results to post. First, I'd like to point out that the link I previously posted regarding the Pi as FM Transmitter does not use bit-banging on the GPIO; instead they use the clock and dynamically modulate the signal to achieve 100+ mhz speeds, which is c...
by AnthonyPaulO
Mon Aug 28, 2017 11:10 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

it's not the feeding it is the responding witin 1us google: hard real time 6502 bus cycle documentation Oh you mean reacting to a 1mhz clock tick? The hope is that I will have everything pre-set by the time the next tick comes along (polling for a transition on the 1mhz clock GPIO; no interrupts of...
by AnthonyPaulO
Mon Aug 28, 2017 9:16 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

I would think that with an Arm processor running at 2+ ghz Is that on the mythical Pi4? :lol: Just being able to toggle the bus at a particular speed isn't much use. You need to be bale to process the information. That will take many more clock cycles, and unless you are going to go bare metal (no ...
by AnthonyPaulO
Mon Aug 28, 2017 8:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

How does spinning a GPIO as fast as possible relate to what you want? This sort of benchmark is of no practical use. Does the Pi control the Apple II bus clock? If so you can slow the bus down to a Pi usable rate. If not you don't have a chance under Linux and I doubt you have a chance with bare me...
by AnthonyPaulO
Mon Aug 28, 2017 7:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

You cannot get a guaranteed 1us response from a pi like that. Not even 2us (as I recall that 500khz was the maximum respone rate) Add an fpga or dual ported memory between the apple bus and a pi (if you need to use a Pi) Thanks for replying! What I'm looking for is to implement a peripheral card on...
by AnthonyPaulO
Mon Aug 28, 2017 6:51 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 10013

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Thanks for replying! What I'm looking for is to implement a peripheral card on the Apple II utilizing the Raspberry Pi 3 as a powerful micro-controller. For this I need to be able to interface the Pi GPIO with the Apple II bus, and I need it to be able to communicate with the Apple II at 1mhz. If I ...

Go to advanced search