CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

SPI OUTPUT(startup time)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

SPI OUTPUT(startup time)
PostPosted: Sun Jul 09, 2017 11:18 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 10, 2017 9:39 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 10, 2017 9:45 am     Reply with quote

I was also thinking it takes a couple cycles to load the buffer as well. I will try to use the spi_prewrite().
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group