 |
|
 |
| Parallax Forums > Public Forums > Propeller Chip > TriBladeProp PCB: Uses 3 Propeller ICs for a Single Board Computer (SBC) | Forum Quick Jump
|
 |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 11/5/2009 4:49 AM (GMT -8) |   | Nooooo... a dead prop?? I was hoping for a photo but I guess the photo might now be one of a charred mess?
I've just got home from work and fired up the board. I'm going to find this /CS bit of code, one way or another. I take it that Spin simply can't print debug messages in an easy way from within sub-objects?
Ok, if that is the case, time for some workarounds. I can at least print debug messages from the main subroutine, so I can narrow down where it calls and object and when it fails to return from that object. So, in the main object is this code:
PRI FindSDblock | i, n, r 'read blockno of file for count into buffer
r := sd.startSD(@ioControl) 'start the SD routines UART.str(string("SD started")) CheckError(not r) UART.str(string("calling mount_explicit")) r := sd.mount_explicit(spiDO,spiClk,spiDI,spiCS) 'mount the SD uart.dec(r) 'print r
It prints "calling mount_explicit" but never prints an r value, so isn't returning from this object.
Unfortunately, mount_explicit is a complex object with all sorts of sub calls, so not easy to trace. So I thought I would start at the beginning and insert this bit of code in the fsrwfemto_rr001 object:
pub mount_explicit(DO, Clk, DI, CS) | startBlk, sectorspercluster, reserved, rootentries, sectors {{ ' Mount a volume. The address passed in is passed along to the block ' layer; see the currently used block layer for documentation. If the ' volume mounts, a 0 is returned, else abort is called. }} abort(99) ' insert this to abort the object with a value?
However, that still doesn't return back to the main object. What am I doing wrong here? I thought the abort command aborted a private or public method with a value? Which would be printed with the uart.dec(r) Or is something wrong with my syntax here?
Help, as always, is most appreciated. Partly this is a learning experience with Spin (which I'm finding much harder than Pasm). So everyone's patience is most appreciated. www.smarthome.viviti.com/buildPost Edited (Dr_Acula) : 11/5/2009 12:57:11 PM GMT | | Back to Top | | |
      |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 11/5/2009 7:46 PM (GMT -8) |   | At work for another 8 hours then will have time to check this out. Heater's explanation makes a lot of sense. Though there are quite a number of abort statements and no \. Maybe they are legacies from earlier testing, but it could explain the whole thing hanging rather than coming back with a meaningful error message. Abort statements seem like 'exit sub' in vb.net, and I've tried to avoid those more recently as they seem to be, dare I say it, an example of poor programming. Better to nest things properly. But that is just a personal opinion.
Some good things might come out of this, as I've had some instances where the triblade hangs on bootup because I forgot to re-insert the sd card. It would be great to have some messages on the screen eg SD card not found, plus other diagnostic messages relating to the card if those are possible. So maybe some different code? (Which I think Cluso was working on anyway for other reasons).
This SD card code is turning out to be some of the hardest coding I've done in ages. Much harder than rewriting the CP/M Bios burning an eprom each time, for instance. And Cluso said it would be easy! Hey, Cluso, don't tell me anything else will be easy, ok *grin*
@Toby, I am very interested in the schematic of the SD card bit. I think it is simply 4 lines with pullups to the prop, and then a fifth pin with a pullup too. I'd just like to confirm that the tracks go to the actual pins on the sd card as I think they do. Then again, if you have a resistor array in the wrong way... www.smarthome.viviti.com/buildPost Edited (Dr_Acula) : 11/6/2009 4:11:12 AM GMT | | Back to Top | | |
     |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 11/6/2009 8:29 PM (GMT -8) |   | Many thanks for the helpful advice. Tried the sd card from the triblade but no luck (and put it back in the triblade just to confirm it hadn't been zapped and it is ok).
Fired up PropDOS. Changed the text. object from a TV to a uart object, so it sends back to a terminal. Commented out the color changes for the moment. Running via a terminal program.
Boots up fine, then gives an error message.
Propeller MiniDOS V1.6 By Jeff Ledger No SD card present. SD card expected on: 13, 14, 15, 9 System halted.
No pullups (but Toby, you said you didn't have any and it worked). Tried three different cards.
I'm still thinking a wiring error. Something like DO and DI swapped (but I have checked and rechecked). On the propeller, CS goes to physcial pin 14, DI goes to physical pin 20, CLK goes to physical pin 19 and DO goes to physical pin 18. On the SD card, pin 1=CS, 2=DI, 3=Gnd, 4=3V3, 5=Clk, 6=Gnd, 7=DO.
I've attached a photo.
If anyone can spot a mistake it would be very much appreciated!
Addit: I have had some success. I put in the pullup resistors. PropDos passes the tests. Now doing some more testing but it would appear I have one working SD card (the micro one from the triblade) and no less than 6 cards of various sizes and brands that do not work. At least I have something to work with now - the wiring is correct etc. These SD cards are difficult little beasties though! www.smarthome.viviti.com/buildPost Edited (Dr_Acula) : 11/7/2009 5:38:59 AM GMT
Image Attachment :
 PICT0162.JPG 429KB (image/jpeg)This image has been viewed 23 time(s). | | | |
| | Back to Top | | |
        |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 11/8/2009 2:45 AM (GMT -8) |   | Propdos certainly is a nifty program. Much like CP/M in many ways!
I can do a DIR and I can TYPE out an entire text file in PropDOS. This really exercises the SD card in terms of current consumption and it is working fine, so I think that makes a power supply problem less likely.
I've got three Sandisk brand cards on the way.
I found another brand of SD card (Kingmax) and that works. Legend brand 512Mb does not work.
Next thing is to try hacking into the zicog code. Cluso has spent some time modifying the SD driver code so that it can share prop pins with other things. I'm looking at a design that simply has 4 dedicated pins, so the upside is that it will be simpler and use existing code. But the downside is that I guess I'm on my own here! I think I have all the bits working though; keyboard, vga screen, sd card in PropDOS and low level read and write to memory. Maybe this will be useful to someone porting Zicog over to other platforms?
Based on all the mods made so far (pullups etc), I sent off to get a new board made. (Actually 10 boards). I'm going for switching regs for both the 3V3 and 5V supplies.
Next step is to try to work out what has been changed from fsrwFemto to fsrwFemto_rr001.spin.
Ok, got that working. Just needed to drop back to the original code, then change 'startSD' to 'start', and change 'mount_explicit' to 'mount'. Got this far (hangs when gets to memory access as I haven't tied that in yet). I haven't changed a huge amount in Cluso's code so it should be possible to do this with ifdefs and run development of the various platforms in parallel (including Cluso's tiny ramblade which I think will really be exciting!). My code aims to drop in existing modules for keyboard, vga, sd card, and then just add some custom code to replace Cluso's triblade ram driver.
ZiCog 1.0_rc_5.5b on the TriBladeProp v0.125 Starting Hdisks... SD startedSD mountedA:ZIPM2_6b.DSK 852817 732392008 B:ZICOG_A2.DSK 639825 732392008 C:DRAC2_64.DSK 279185 732392008 D:ZICOG_SC.DSK 803665 732392008 E:ZICOG_E2.DSK 721745 732392008 F:ZICOG_F0.DSK 738129 732392008 G:ZICOG_G0.DSK 770897 732392008 H:ZICOG_H0.DSK 787281 732392008 R:BOOTHDSK.32M <-bootcode 115281 732392008 Loading SRAM... Boot code loaded Starting Z80 emulation... Passed, please wait...
www.smarthome.viviti.com/buildPost Edited (Dr_Acula) : 11/8/2009 12:00:44 PM GMT | | Back to Top | | |
     | 849 posts in this thread. Viewing Page : | | Forum Information | Currently it is Friday, November 20, 2009 11:14 PM (GMT -8) There are a total of 393,738 posts in 55,521 threads. In the last 3 days there were 82 new threads and 702 reply posts. View Active Threads
| | Who's Online | This forum has 17687 registered members. Please welcome our newest member, mark09. 48 Guest(s), 2 Registered Member(s) are currently online. Details BradC, SRLM |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|