Cannot get program running after upload
Andrey Demenev
Posts: 399
in Propeller 2
I am trying to run some sample programs on P2, and I am having a strange issue. After I upload the program, it looks like it is not starting. I tried simple blinker, and some VGA demos, and the behaviour is the same: upload goes fine, but the program is not working. The only way I can make it start is using the "upload to ram with debug" button in spin tools IDE.
Is there something I might be missing? Or probably the chip is damaged in some weird way?

Comments
Maybe a clock issue? Debug might force the clock speed ?
Can you run it from Prop tool as a check?
Debug can slightly change timing of things.. maybe make a copy and start removing debug until it fails?
Does not look like that
Another observation:
I can use "upload to ram with debug" or "upload to flash with debug" - both work as expected
"upload to flash" – looks dead, reset does not help
"upload to ram" – restarts whatever was in the flash, but only if it was flashed with debug. If flashed withou debug, it's dead
It does not matter if I use debug statements or not. It is the upload mode in the spin tools that triggers that
Can it have something to do with reset circuitry? I used this board before without issues. Now I made another programming adapter, and i am using DTR for reset. I do not remember which signal was used for reset before. The only thing that changed since last time is the adapter. I do not have access to the old one
Got no Windows machine
AI says to add a short delay to the beginning of the program.
And also check the boot switches if you’re using an eval board
+1
I ran into a switch setting issue before (Evan helped me out of it). On my Eval and newer P2 Edge the Reset and Flash switches are on, the others are off.
Do you have an SD Card installed? If so, remove it.
Ensure that flash is set to "On" on the dip switches.
P2 Edge, no SD card, flash and led dip switches are on, the other 2 are off.
I change the reset signal to RTS, still behaves the same way
Still suggest make a copy and remove debug statements until it fails and use that to figure it out…
Could also be a power problem…. Somebody should make a base that has usb-c for those modules…
There is nothing left to remove:
PUB test() repeat pinhigh(56) waitms(500) pinlow(56) waitms(500)@"Andrey Demenev" Didn't you say it worked with debug but not without?
That does sound like a reset after download is happening. Please post the schematic for the adapter you've built.
this is not about debug statement in the code. It is about the upload mode in spin tools
It's just a usb/uart converter and some reset circuitry copied from propplug, except I have external resistors, not embedded into transistor
Okay, that's straight forward. Good.
What about supply circuit. How is the Edge Card getting its power?
Through the barrel connector on the edge breakout board, from a 5V/2A wall adapter. The same I used before.
The only variable is the USB-UART converter. It was FT232, now it's CP2102. Probably there's some difference in control signals timings. I am going to grab an FT232 and try it
The upload is the same for both modes, however with the debug mode, the serial port is left open to allow the console to display messages from the propeller. In normal mode the serial port is closed after the upload, unless it is used by the serial terminal, my suspect is that closing the port toggles the dtr/rts signals and triggers a reset.
You can try to upload in normal mode with the serial terminal open (or select upload to RAM with terminal), this should keep the port open after the upload.
Also, upload to FLASH without debug should work because the flash programming is done by the propeller itself before completing the upload, not sure why this doesn't work.
Hope this helps.
Oh, not using prop plug but home made thing, ok. That is most likely the problem. Something might be wrong with it for this application …
Make sure the cap is right…
Or, maybe it is the host.. Linux? Maybe as @macca said it is closing the port after upload…
But upload to flash not working is probably an indicator of something…
Hi
I think you need to post the ACTUAL circuit you are using- I see the signage for the cap but NOT its position.
You do know it has to go BETWEEN the DTR/RTS and the transistor base?
Dave
Yes, I know that, and I can read a schematic diagram . The circuit I am using is exactly as prop plug.
Finally I got it working using this
Essentially I am using the control line directly to reset the chip, instead of inverting it. Now it works in Spin Tools in all modes, and in FlexProp
I do not know what is going on here
I am sure people use these programming environments a lot and do not have these issues.
@macca I looked over the Spin Tools source, and I see that RTS and DTR have initial state depending on whether the OS is Windows or not. What is the reason for that?