View previous topic :: View next topic |
Author |
Message |
curt2go
Joined: 21 Nov 2003 Posts: 200
|
SPI OUTPUT(startup time) |
Posted: Sun Jul 09, 2017 11:18 pm |
|
|
Ok. I have figured out a way to sort of get my little project off the ground. But each time I think that I hit another snag.
24EP512GU810 chip
5.061 compiler.
setup_spi2(SPI_SLAVE | SPI_L_TO_H | SPI_MODE_16B);
fast IO setup on G port..
spi_write2_16(0x8000);
I am clocking the SPI from an external source. Clocking it at 352 KHz. What I am running into is how many clock cycles does it take to start clocking out the SPI? It looks like it is taking about 4? You would think that it would start clocking out immediately.
Any help would be appreciated. |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jul 10, 2017 9:39 am |
|
|
The data sheet says:
http://ww1.microchip.com/downloads/en/DeviceDoc/70616g.pdf
Quote: |
18.1 SPI Helpful Tips
1. In Frame mode, if there is a possibility that the
master may not be initialized before the slave:
a) If FRMPOL (SPIxCON2<13>) = 1, use a
pull-down resistor on SSx.
b) If FRMPOL = 0, use a pull-up resistor on
SSx.
--------------------------------------------------
Note: This insures that the first frame
transmission after initialization is not
shifted or corrupted.
------------------------------------------------- |
|
|
 |
curt2go
Joined: 21 Nov 2003 Posts: 200
|
|
Posted: Mon Jul 10, 2017 9:45 am |
|
|
I was also thinking it takes a couple cycles to load the buffer as well. I will try to use the spi_prewrite(). |
|
 |
|