View previous topic :: View next topic |
Author |
Message |
Xavi
Joined: 12 Aug 2006 Posts: 2
|
CLOCK in spi_read() |
Posted: Sat Aug 12, 2006 10:02 am |
|
|
Hello,
Can I define the number of bits to read?, or the same is, can I define the number of clock out. the system is a pic in a master spi comunication and I need to read 19 bits.
Thank you in advance. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Aug 12, 2006 12:08 pm |
|
|
The spi_read() function uses the hardware SPI module in the PIC.
It can only read 8 bits. So if you want to read 19 bits, you must
call spi_read() three times. This will read 24 bits.
If you want to read exactly 19 bits, you can do it with software SPI.
For examples, look at the CCS driver files for SPI eeproms, such
as 9346.c. Look for driver files in this folder:
c:\Program Files\PICC\Drivers |
|
![](templates/subSilver/images/spacer.gif) |
Xavi
Joined: 12 Aug 2006 Posts: 2
|
|
Posted: Sun Aug 13, 2006 3:45 am |
|
|
Thank you, now I know and I make my own routines. |
|
![](templates/subSilver/images/spacer.gif) |
|