Is there a document that exists to explain how the byte codes are sent to the propeller?
Don M
Posts: 1,652
Was looking at the communication between Propeller Tool and the Prop 1 with a logic analyzer. Is there a specific baud rate used? I thought I'd seen some conversation way back in the day that explains how the code is sent but can't seem to find it.
Thanks in advance.
Comments
The reason for my asking is I would like to try and have the RP2040 Pico send a binary file that was saved from Propeller Tool to a connected Propeller 1. I have a project in mind that I will be using the 2 connected together and thought maybe the Pico could emulate the programming of the Propeller. I'm able to read the binary file on the Pico. I'm guessing there must be a specific baud rate and timing that needs to be adhered to.
Look in the Propeller Tool library for an object called ProperLoader.spin. It shows how to use a P1 to program a P1 -- you'd have to convert this to C or Python for the Pico. This might be tricky but your logic analyzer should be helpful it sorting out timing stuff.
Or... you could roll your own (more code, but you decide how it works). If you have serial coms between the Pico and the P1 you could send a command that says, "Hey, here comes a new program to load into memory." Send the data from the Pico to the P1 and on the P1 side write it to the EEPROM. Once finished, the P1 could do a checksum of the EEPROM to send back to the Pico. If the Pico agrees, the P1 can reboot into the new code.
In the laser tag product I designed we read the binary image from an SD card into the EE and reboot. This lets us break laser tag into constituent applications (Editor, Player, Referee). The compiled binary stops at the code; the P1 side clears the rest of the EEPROM and writes the initial stack frame. @"Jeff Martin" (Parallax) showed me how to do this but I cannot find the email that contains the details.
This code works. In your case you could send a buffer across, maybe even with a checksum per buffer. Write that the the EEPROM and tell the Pico you're ready for the next. Once all the blocks are written do the clean-up (this is why all global variables start as 0) and setup the stack frame.
https://github.com/rosco-pc/propeller-wiki/wiki/Download-Protocol
Thanks @JonnyMac. I had forgotten about that program. I've actually used it is some previous projects. That helps a lot.
Thanks @rosco_pc Very informative. Just what I was looking for.
Here's a PDF with some propeller programming info.