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

Propeller-based PIC32 programmer

AleAle Posts: 2,363
edited 2014-12-14 21:50 in Propeller 1
I have one pic32: 32MX120 or so, I'D like to use those 28 DIP PIC32s, they have up to 256K flash, and they are supposed to be very low power. I also have some lpc and st32 ARM-based controllers but well, I'd really like to test the pic32.

I'd like to program/try the pic32 but I haven't got a pickit3 or whatever one need to program them. But I have loads of, sadly, unused propellers.
Note: I made once a BDM for coldfire that sort of worked but my coldfire board had a problem I couldn't figure out. I know it is not the same but I mean Propellers have some really nice features, and for this task, I think it could be appropriate.

Have someone tried this before ?

I tried pic32prog with an Olimex ARM-OCD-JTAG but without any success (not that I had any success with this dongle and ARM7TDMI-based controllers at the time either....), maybe that thing is broken..

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2014-12-14 03:39
    IIRC the PIC32 use standard 3V3 for programming so it should be fairly straight forward.
    I have done one for the ATTiny family.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-14 07:57
    All the information for programming the pic is available in the manuals, and Cluso99 is correct, it uses standard 3.3V. Requires a lot of bit banging and twiddling but that's not a problem. The prop excels at that.
  • AleAle Posts: 2,363
    edited 2014-12-14 21:50
    Yes, everything is published :), and bitbanging is not a problem. I wrote already some code, let's see if I can get it to work :)


    ' Sends a 3 bit TMS header
    ' Clock is low
    send_TMS_header         or      OUTA, #1<<TMS
                            nop
                            andn    OUTA, #1<<TDI
                            or      OUTA, #1<<TCK
                            nop
                            andn    OUTA, #1<<TCK
    
                            andn    OUTA, #1<<TMS
    
                            or      OUTA, #1<<TCK
                            nop
                            andn    OUTA, #1<<TCK
                            nop
    
                            or      OUTA, #1<<TCK
                            nop
                            andn    OUTA, #1<<TCK
    send_TMS_header_ret     ret                        
                                                                                        
    ' Sends a 3 bit TMS footer (last bit of data + 2 bit footer)
    ' Clock is low
    send_TMS_footer         or      OUTA, #1<<TMS
                            rcr     sdata, #1 wc
                            muxc    OUTA, #1<<TDI   ' sets/clears TDI according to MSB of sdata 
                            or      OUTA, #1<<TCK
                            test    OUTA, #1<<TDO wc ' get state of TDO
                            rcr     idata, #1       ' shift in
                            andn    OUTA, #1<<TCK
                            nop
    
                            or      OUTA, #1<<TCK
                            nop
                            andn    OUTA, #1<<TCK
    
                            andn    OUTA, #1<<TMS
    
                            or      OUTA, #1<<TCK
                            nop
                            andn    OUTA, #1<<TCK
    send_TMS_footer_ret     ret
    
    ' Sends a 3 bit TMS footer (last bit of data + 2 bit footer)
    ' Clock is low
    send_Data               cmp     scnt, #1 wz
                  if_z      jmp     #send_Data_ret  ' last bit as footer              
                            rcr     sdata, #1 wc
                            muxc    OUTA, #1<<TDI   ' sets/clears TDI according to MSB of sdata 
                            or      OUTA, #1<<TCK
                            test    OUTA, #1<<TDO wc ' get state of TDO
                            rcr     idata, #1       ' shift in
                            andn    OUTA, #1<<TCK
                            
                            sub     scnt, #1
                            jmp     #send_Data
    
    send_Data_ret           ret
    
    
Sign In or Register to comment.