View previous topic :: View next topic |
Author |
Message |
Torello
Joined: 29 Sep 2006 Posts: 120
|
Polling SDI whilst using the build in SPI |
Posted: Thu Jul 21, 2011 10:26 am |
|
|
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
|
|
Posted: Thu Jul 21, 2011 2:48 pm |
|
|
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
|
|
Posted: Thu Jul 21, 2011 3:45 pm |
|
|
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
|
|
Posted: Sat Jul 23, 2011 1:08 am |
|
|
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
|
|
Posted: Sat Jul 23, 2011 6:16 am |
|
|
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
|
|
Posted: Sun Jul 24, 2011 10:59 am |
|
|
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
|
|
Posted: Tue Jul 26, 2011 5:37 am |
|
|
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 |
|
|
|