SPI for self clocked AD converters

Questions on control of serial busses
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

SPI for self clocked AD converters

Post by YahooArchive »

>from the help line
>I have been unsuccess to get the Armmite pro to interface with an external ADC
using SPI. How can I control the clock speed/sampling rate using the SPI
commands in Basic? The documentation states the clock speed is set at 300kbps.
However my ADC supports only 100kbps.

You will need to slow down the SPI for the ADC you are using.

The source for the SPI routine is in

/Program Files/Coridium/BASIClib/SPI.bas

The inner loop for SPIOUT is

while i and $ff
OUT(OUTpin)=(i and outByte)
SPIclkACTIVE
SPIclkIDLE
i = i << 1
loop

something like this might work, you will need to experiment-

while i and $ff
OUT(OUTpin)=(i and outByte)
SPIclkACTIVE
SPIclkACTIVE
SPIclkACTIVE
SPIclkIDLE
SPIclkIDLE
SPIclkIDLE
i = i << 1
loop



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: SPI for self clocked AD converters

Post by YahooArchive »

Bruce,

If he/she is not using the microsecond timer somewhere else, something like
this may work:

while i and $ff
OUT(OUTpin)=OUT(OUTpin)=

Post Reply