After successfully interfacing a number of ADC chips using polled mode I’m now trying to use interrupt mode, however this is being annoyingly elusive.
So far I have added code to the SPI module, I wrote some time ago, to us the interrupt vector at &100 (note I'm using RISCOS) and have enabled the SPI interrupt bit (22) of the “Enable IRQs 2”, pages 112-113 of the BCM2835 documentation. Also, setting the appropriate GPIO pins to Alt 0 and setting the “CS Register” as in the process on page 158 for interrupt mode.
The vector is working fine with all IRQs being routed through my handler which are then being passed on to the original address. However on setting the CLEAR an TA bits of the CS Register, according to the documentation this is meant to trigger the first interrupt with DONE being set but that’s not happening. I could try setting TA without setting the CLEAR bits at the same time but I wanted to clear the FIFO’s before entering my handler.
I have connected an oscilloscope to check the pins but only the SPI clock pin is active, MISO and MOSI are both inactive.
All is in ARM assembler.
Any clues what I’m missing?
An update: Looked more closely at the voltages on the SCLK, MISO and MOSI pins. The oscilloscope shows a good clock on the SCLK pin but on the MOSI pin the signal is only a fraction of the 3.3V so is probably too small for the mcp3002 chip on my Gertboard to detect. Using polled mode I have no issues, ADC works fine with 3.3V signals on all pins.