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

Polling SDI whilst using the build in SPI

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



Joined: 29 Sep 2006
Posts: 120

View user's profile Send private message

Polling SDI whilst using the build in SPI
PostPosted: Thu Jul 21, 2011 10:26 am     Reply with quote

Hello,

I am writing code for a serial flash memory (MX25L25635E, 256Mbit). This chip can put the "write in progress" bit out on the SDI line in its several write modes. Polling this bit is must faster then issuing a SPI command to read the status register to get this bit.

Does anybody know if, and how the SDI can be polled whilst the SPI module is enabled?

Regards,
Edwin
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Jul 21, 2011 2:48 pm     Reply with quote

You would have to disable the SPI module to poll the port
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Thu Jul 21, 2011 3:45 pm     Reply with quote

I don't think you do.
Provided you just read the pin, it should still work. If you look at the port block diagram for a typical chip, the peripheral select turns off the output functions on the port, but the input functions are still left enabled.
_However_, there is a significant caveat. On many chips the SPI input uses a Schmitt trigger input latch, while reading the port uses a TTL latch, so the logic levels you'd be testing would differ from what SPI uses. Might cause a problem...

Best Wishes
Torello



Joined: 29 Sep 2006
Posts: 120

View user's profile Send private message

PostPosted: Sat Jul 23, 2011 1:08 am     Reply with quote

Thanks all,

I think I give it a try. Levels should not be a big issue a I see the signal on the scoop nicely go to 3v as on which flash and pic works.
Problem with the MX25 is that they specify tBP as 9 upto 300us. Well that's quite a range! Surely don't want to wait 300us for each byte.
But also Tpage_program goes from 1.5 to ~5 ms.
And I can't affort flash errors...

Regards, Edwin.
http://www.uva-bits.nl/system/
University of Amsterdam Birdtracking System
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Jul 23, 2011 6:16 am     Reply with quote

You should mention the involved processor type. At least for PIC18 and PIC24, the peripheral function doesn't disable the digital input buffer, this is only the case for analog inputs. So a pin read, e.g. by input_state(), is supposed to work on the SDI pin.
Torello



Joined: 29 Sep 2006
Posts: 120

View user's profile Send private message

PostPosted: Sun Jul 24, 2011 10:59 am     Reply with quote

It's a Pic18. I'll give it a try and will report my findings.
Thanks all,
_________________
Regards, Edwin. PCWHD v5.114
Torello



Joined: 29 Sep 2006
Posts: 120

View user's profile Send private message

PostPosted: Tue Jul 26, 2011 5:37 am     Reply with quote

Confirmed! It does work. No need to disable the hardware SPI, you can poll the DI line any time.

regards,
_________________
Regards, Edwin. PCWHD v5.114
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