Larson scanner looks strange when flashed to Eval board B
Rayman
Posts: 14,646
Attached is Jon's Larson scanner code.
It works as expected when loaded to RAM.
But, when burned to flash, it acts strangely...
P58 and P59 stay off and P60 stays on.
Does the bootloader not release control of the flash pins after booting?
It works as expected when loaded to RAM.
But, when burned to flash, it acts strangely...
P58 and P59 stay off and P60 stays on.
Does the bootloader not release control of the flash pins after booting?
Comments
Now you mention it, I realise now it never affected me because my regular reusable testing code tests every smartpin for presence as it's first job ... and part of that is to reset each smartpin as it goes.
To clear everything all a once...
Strangely, it seemed to reboot after flashing with that line included...
I'm not sure how that is possible...
I don't know, now it always seems to reboot after 4 seconds...
Wasn't earlier...
I think it's the flash loader in the ROM that is not releasing the pins.
The flash loader using for loading a binary into the flash doesn't matter (?)
I not even sure... Does a soft reboot reset the smart pins?
Note: I think this is technically a warm reset as done by code and not by cycling power or reset switch.
Does this clear the smartpin states?
I think it has to be in the Larson scanner code in order to work...
I read that as being good as the external hard reset.
Adding to loader might help when programming RAM over serial port, but not when booting from flash.
A soft reset is just a simulated equivalent that goes through the rebooting steps without the hardware actually being reset at all. Wikipedia is heavily PC industry biased but here's a quote anyway "A soft reset is performed by restarting system software without resetting the hardware." - Reset_(computing)
EDIT: Grr, the forum software doesn't auto handle brackets as part of a link.
That FlashLoader.spin2 actually inserts a second stage loader (part of itself) into the flash chip. It occupies the first 1 kByte of EEPROM space and so is all that gets loaded by the ROM. It then sets up the smartpins for a fast load of whatever program has be put in there. After that is completed it then COGINITs into the target program. But the smartpins used for the fast loading aren't being turned off at the moment, that's the part I'm adding the three WRPIN #0 instructions to do.
In terms of the sequence, there is only one instruction, the COGINIT, inbetween my recommended fix and what you've added.
Interesting...
That sounds like the best thing... If serial, SD, and flash can all do this...