Shop OBEX P1 Docs P2 Docs Learn Events
Propeller programmer — Parallax Forums

Propeller programmer

Wizard77Wizard77 Posts: 2
edited 2014-09-29 18:10 in Propeller 1
Looking for coding to have BST or a spin program a prop to then program another prop in the field. I have seen threads from 2006 for "Propeller Loader v1.0", but it is not complete. The top is commented out and when it is compliled, it looks for Propellerloader". Looking for the complete code or other code that will work. There is mention of the "prop stick" from a vendor, but they are not available with the program coding.

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2014-09-24 16:55
    Wizard77 wrote: »
    The top is commented out and when it is compliled, it looks for Propellerloader"

    You mean this one? PropTool has most stuff included (so you wouldn't usually notice), for bst you need to grab them individually.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-09-24 17:15
    Wizard77 wrote: »
    Looking for coding to have BST or a spin program a prop to then program another prop in the field. I have seen threads from 2006 for "Propeller Loader v1.0", but it is not complete. The top is commented out and when it is compliled, it looks for Propellerloader". Looking for the complete code or other code that will work. There is mention of the "prop stick" from a vendor, but they are not available with the program coding.

    Most of my Prop boards include I2C on the programming header so it's a simple matter to access the target's EEPROM directly rather than using the serial bootloader. The advantage of this is it is possible to clone and burn, or load more than 32K, or even just change a few configuration constants. If you design your own boards I would recommend this approach, it costs nothing and the pin arrangement of 4 PropPlug comptible pins alongside the I2C and VDD prove very useful.
  • richaj45richaj45 Posts: 179
    edited 2014-09-24 22:12
    @Peter

    Do you use a I2C adapter driven from the PC to load the EEPROM?

    If so what adapter and what software do you use?

    Thanks
    rich
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-09-24 23:15
    richaj45 wrote: »
    @Peter

    Do you use a I2C adapter driven from the PC to load the EEPROM?

    If so what adapter and what software do you use?

    Thanks
    rich

    Last time I did this I just used exactly the same board as the target with an extension cable/plug. I had a simple jumper on the programmer board that decided if it needed to copy from the target or program the target automatically when I connected it. This is the simple bit of Forth code I used:
    TACHYON
    [~
    
    pub FSRPROG.fth    ." P1336 Field Programmer        131024.0000 pbjtech " ;
    
    #P3    == STATLED
    
    #P8    == STX
    #P9    == SRX
    #P10    == SDA2
    #P11    == SCL2
    #P12    == SRST
    
    $800    == CHUNK            --- Program 2K chunks at a time
    
    : LED    ( on/off )    STATLED MASK OUT ;
    
    : SLAVE
        SRST PINCLR
        SDA2 SCL2 I2CPINS ( sda scl -- )
        ;
    
    : RELEASE
        STX 5 MASKS INPUTS
        EEPROM
        ;
    
    : PROGRAM
        0 $8000 ADO 
          EEPROM I $8000 + BUFFERS CHUNK ELOAD 
          ON LED 
          SLAVE BUFFERS I CHUNK ESAVE
          OFF LED
          CHUNK
        +LOOP
        RELEASE
        ;
    
    : COPY
        0 $8000 ADO
          ON LED # #10 ms OFF LED
          SLAVE I BUFFERS CHUNK ELOAD        \ read in a chunk of EEPROM from target
          EEPROM BUFFERS I $8000 + CHUNK ESAVE    \ save chunk in upper 64K of programmer
          CHUNK
        +LOOP
        RELEASE
        ;
    
    --- If jumper/switch is closed then just copy the target's EEPROM rather than program it
    
    : COPY? ( -- flg )
        #P30 PINCLR #P31 PIN@ 0= #P30 PINSET #P31 PIN@ AND
        ;
        
    : TARGET? ( -- flg )
        SDA2 PINCLR SDA2 MASK INPUTS SDA2 PIN@
        ;
        
    : PROGRAMMER
        BOOT
        CR CR FSRPROG.fth
        ON LED
        #300 ms 
        OFF LED 
        TARGET?
        ESC? NOT AND 
        IF 
          COPY? 
          IF 
            #300 ms
            CR ." Copying the target firmware " COPY
          ELSE
            CR ." Programming the target " PROGRAM
          THEN
             
        OFF LED
        THEN
        EEPROM
        $A0 STATLED DAC!
        ;
            
    AUTORUN PROGRAMMER
    
    ]~
    END
    
    Screenshot from 2014-09-25 16:38:41.png
  • richaj45richaj45 Posts: 179
    edited 2014-09-25 10:44
    @Peter

    So what are [~ and ]~ symbols?
    What boards are you using?

    cheers,
    rich
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-09-25 14:10
    richaj45 wrote: »
    @Peter

    So what are [~ and ]~ symbols?
    What boards are you using?

    cheers,
    rich

    The tilde sequences were part of the serial receive cog at one stage so that it could control it's filters. The idea was that it would not buffer comments etc, skip multiple whitespace etc but it also caused problems for when I did want it to buffer. So those tilde sequences are only there at the high level to instruct Tachyon to filter this out, not echo etc, although there is probably no reason I can't just integrate them into the TACHYON and END words which define bulk source code load mode, that is it prints line numbers, stays on the same line without echoing etc, reports errors, and finally reports compilation stats at END.

    The only Parallax boards I own are the original demo board and a Spinneret, I have scores and scores of my own designs, and that little FSR board was designed to fit into a Maxon motor controller housing (used on a robotics line) which could take little adapter boards, so I made an adaptor board which this Prop board is mounted on vertically inside the same housing. That way the equipment didn't need recertification plus they were losing millions so they needed it urgently. It used a Force Sense Resistor on the gripper arms and it was easier to program this sampling and filtering/analysis on the Prop than to squeeze it into a tiny core which my base pcb allowed for anyway. It also had a current allocation of less than 20ma which was still in the Prop's ballpark after I tweaked Tachyon's idle cog behaviour.
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2014-09-25 17:54
    Wizard77, Welcome to the forums!

    If I understand you correctly, you want one Propeller to carry a program to load into other Propellers out in the field or factory or classroom, without having to carry along a PC. I think you already found Chips' PropellerLoader.spin, but were puzzled by how to apply the instructions laid out in the COMments section. It's really quite simple.

    1) Compile as a binary the program that you want to transfer to the field Props. In bst choose the menu option, compile/compile and save binary. There is a similar option in the Propeller tool. You can name the binary file anything you want, but take Chip's example and name it, loadme.binary.

    2) Now start a new program and enter it as follows, again following Chip's example. When done, load it (bst: Compile and load EEPROM) into the Prop you are going to transfer to the others in the field. It will incorporate Chip's PropellerLoader code, and it will incorporate, as DATa, the binary image of your target program. Note that there has to be room in the Prop for both programs, but PropellerLoader is quite small, so you should have room for quite a large target program.

    Screen shot 2014-09-25 at 5.31.34 PM.png


    3) Carry this host device to the field site, and there connect it to a target slave. Wire pin p0 on the host to RSTn on the slave, p1 on the host to rx (p31) on the slave, and p2 on the host to tx (p30) on the slave. Apply power to the slave and then to the host, and a moment later your target program will be cloned into the slave's eeprom. You can add a signal somewhere, LED or something, to indicate completion. Then, onto the next Prop in the field.
  • Wizard77Wizard77 Posts: 2
    edited 2014-09-28 18:29
    Got it working!!, thanks to all that responded. I noticed that there are errors detected in the program, is there a way to trip an output when there is an error? I am familiar with BST, not spin, but learning.
  • kuronekokuroneko Posts: 3,623
    edited 2014-09-28 19:30
    Wizard77 wrote: »
    I noticed that there are errors detected in the program, is there a way to trip an output when there is an error?
    You mean errors during loading/programming the other chip? If so simply catch the return value of the Connect method call (errors are non-null small integers).
    if loader.Connect(2, 1, 0, 1, loader#ProgramShutdown, @payload)
        dira[16] := outa[16] := 1          ' indicate failure on pin 16
        waitpne(0, 0, 0)                   ' stay here
    
  • msrobotsmsrobots Posts: 3,704
    edited 2014-09-29 18:10
    kuroneko wrote: »
    ...
        waitpne(0, 0, 0)                   ' stay here
    

    Die schwartze Katze wieder ...

    Even in case of a failure saving energy instead of using a simple 'repeat'. to stay?

    You should write a book about programming the propeller. Just take all of your posts and sort them by relevance. Throw some explanations in there for people like me and you will have a bestseller.

    @Mike G. has modified this proploader to read a file from sd card instead of including the compiled binary into the loader. Simple change and works perfectly. Can't provide a link. But it's there. Somewhere in the Spinneret stuff. Programming a propeller from a propeller. Google it!

    Enjoy!

    Mike
  • Does anyone know of a propeller programmer in a thumb drive format? I would like to have one or two so I could send them out in the field to update my customer's firmware. They need to run chips' PropellerLoader.spin

    If not I will put something together just wanted to check if something was out there.
  • Cluso99Cluso99 Posts: 18,069
    John,
    Not sure what you are asking..
    Do you want a tiny prop board that can program your customer prop's eeprom using PropellerLoader.spin?
    Do you want a complete solution?
  • JohnR2010JohnR2010 Posts: 431
    edited 2016-01-20 15:41
    Yea I guess I wasn't too clear. I need to update the firmware on a few remote propeller devices I have out in the field. Instead of lugging my laptop around and reprogramming each one with the Prop Plug I was hoping someone had created a programmer. I was thinking I could load up my new firmware with Chips' PropellerLoader.spin. Something in a nice small case, battery powered I could carry with me or send out to customers. If there isn't anything out there I will put something together but wanted to check first.

    Thanks!!
    Cluso99 wrote: »
    John,
    Do you want a tiny prop board that can program your customer prop's eeprom using PropellerLoader.spin?

    The answer is Yes.

  • Cluso99Cluso99 Posts: 18,069
    John,
    While it is not in a box, you might find my P8XBlade2 a nice fit.
    http://forums.parallax.com/discussion/163052/cluso-s-p8xblade2-tiny-p8x32a-propeller-development-board-us-16/p1

    It has a microSD card for files and a mini os. It would not be too difficult to download a binary file on the SD card to update your prop boards using PropellerLoader.
    You could use a couple of leds on the I/O to indicate success/failure.

    You would need to work out where you will get power from. My board requires 5V regulated.
  • That is such a cool board I saw that when you announced it. Even asked a question about it in your post but didn't get an answer or maybe it got lost in all the post.

    My question was around your voltage regulator. If I recall correctly I looked at your schematic and it is a liner regulator but I was curious about its efficiency (do you have a part number)? I was trying to determine its efficiency for a battery based project? I'm guessing I could power this with 4 AA batteries.

    My follow-up question is how are you manufacturing these? To sell them at such a good price I'm guessing your not baking them yourself! Just curious about who you use and lot sizes etc.

    Thanks!!
    Cluso99 wrote: »
    John,
    While it is not in a box, you might find my P8XBlade2 a nice fit.
    http://forums.parallax.com/discussion/163052/cluso-s-p8xblade2-tiny-p8x32a-propeller-development-board-us-16/p1

    It has a microSD card for files and a mini os. It would not be too difficult to download a binary file on the SD card to update your prop boards using PropellerLoader.
    You could use a couple of leds on the I/O to indicate success/failure.

    You would need to work out where you will get power from. My board requires 5V regulated.

  • Cluso99Cluso99 Posts: 18,069
    The regulator is an LDO but since it is a SOT23-3 (no space for anything bigger) it is not able to dissipate a lot of heat. Switchers require space and $. The vregs can vary. I was using MCP1700/1702, but I am using an OnSemi part now.

    I build these myself with a Torch T200C reflow oven and hand placed components. I use a solder screen and lead free solder paste. I couldn't do this price if I had to get them assembled outside as cost would be prohibitive. Because I do it as a hobby to get others interested in the prop, I don't care about my time, and just make enough to keep my hobby going.

    I build the underside in larger numbers and then finish the topside in smaller numbers almost to order as the prop is the most expensive part. The boards are panels of 10 and are blue ENIG.

    Not sure how long 4x AA would last. Mostly will depend on what the prop is doing and attached parts.
Sign In or Register to comment.