Shop OBEX P1 Docs P2 Docs Learn Events
FSRW + SD only working on one set of Prop pins => CABLE LENGTH!! — Parallax Forums

FSRW + SD only working on one set of Prop pins => CABLE LENGTH!!

phubnerphubner Posts: 7
edited 2014-02-24 06:44 in Propeller 1
Hi Everyone, its been a while!

I'm modding an existing hardware board by adding an SD card. FSRW works great... but ONLY on pin ports 23-24-25-26 :confused:
The existing board is constrained to available p0-3 and p24-27. I've been prototyping on my Prop Pro Dev board.

Running the fsrw26 sd card test code test.spin, I get expected results using p23-p26 (as set in sysdep.spin) :
...
Clock: 80000000 ClusterSize: 4096 ClusterCount: 62387
Raw write 3968 kB in 2309 ms at 1718 kB/s
Raw read 1920 kB in 2188 ms at 877 kB/s
fsrw pwrite 992 kB in 2317 ms at 428 kB/s
fsrw pread 992 kB in 1137 ms at 872 kB/s
FSRW pputc 63 kB in 2112 ms at 29 kB/s
FSRW pgetc 63 kB in 1840 ms at 34 kB/s
All done!

but if I change to p0-3 or p24-27 (or any other pin ports ... I've check most others!) in sysdep.spin, I get a fail on the boot block in test.spin PUB mounttests. Same hardware, same SDcard, etc, only the p#s used change.
Mount tests first
First mount.
Succeeded; stopping cog.
Second mount.
Succeeded.
Reading block 0 (should be a boot block)
Read finished; checking for boot block signature
boot block signature not found
Erroneously returned from start!
-1234

In this case I am simply changing the pin definition by +1 and moving the wires over by one. All my definitions are correctly maintained (DO, CLK, DI, CS) just relocated. I have gone back and forth, rechecked cabling, code settings many, many times to no avail. I hope there is a solution that I've just blinded myself to... (like is there another place to change the p# definition??)

Thanks in advance for input!

Paul

ps:"I feel like I'm taking crazy pills!" - 'Jacobim Mugatu

Comments

  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-02-23 19:05
    I use FSRW on a lot of projects, and never with the same set of pins. I suggest using mount_explicit() as it allows you to specify pins that many not be in the correct order for mount().
  • phubnerphubner Posts: 7
    edited 2014-02-23 21:16
    Jon,

    Good suggestion. At this point I'm trying to get the fsrw26 sample/demo code working by only changing the p#s and selecting the safe_spi.spin (as its slow and reliable). It's all stock code from there. I even d/l'd a fresh copy to make sure I didn't make inadvertent changes somewhere. No go.

    The key is that the SD cards actually mount on all p#. It just cant read data from the card.

    FSRW's test.spin sample code does an explicit call with the safe_spi.spin's PUB start_explicit. I've tried the faster but less robust SPI files with the same result :-(
    DO CLK DI CS PPDB    Target Board
    23 24  25 26 Perfect (pins n/a)
    24 25  26 27 Nope*   Nope*
    
    *=Mounts 2ce, then dies on the 3rd test. identical issues.
    

    I had hoped to get the sample code working to then assure myself I had the setup correct, but this gremlin is not letting me advance. I wired this to my project;s board (p24-27) and got the same (bad) results as on my PPDevBoard.

    Any other suggestions?

    Paul
  • AribaAriba Posts: 2,690
    edited 2014-02-23 21:56
    Have you other objects running which mess with your SDcard pins?
    For example the Keyboard drivers normally use pin 26 and pin 27.

    Andy
  • kuronekokuroneko Posts: 3,623
    edited 2014-02-24 01:20
    FWIW, just ran the test on pins 0..3 (DO/CLK/DI/CS) on a QuickStart HID board. Works as advertised.
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-02-24 04:41
    The card is able to mount, so the pin connections are OK. The problem is either with the SD card itself or maybe the length of the wires you're using. Can you try P23-P26 again to see if that still works? Also can you try using shorter wires? A picture of you hardware setup would be useful.
  • phubnerphubner Posts: 7
    edited 2014-02-24 06:44
    WORKING!

    @Dave - Thanks!! I completely ignored cable length. In fact, I just received and started using a pack of premade 6" jumpers. Replaced with 1" and it is working properly. It's still odd why it worked on one set of pins and not another, but I guess it was a fringe use case.

    @Ariba - I was running only the fsrw sample code. thx!
    @Kuroneko - I appreciate you running the fsrw test code to confirm my setup.

    You guys are the best.

    Paul
Sign In or Register to comment.