Shop OBEX P1 Docs P2 Docs Learn Events
programming a propeller with another propeller — Parallax Forums

programming a propeller with another propeller

dr hydradr hydra Posts: 212
edited 2015-05-27 06:22 in Propeller 1
I know it's a strange question...but has anyone used a propeller to program another propeller? The reason I am asking is that I have an ARM chip that can function as a USB to Uart bridge...however, it does not have a CTR line to control the reset for programming the propeller. So, my idea is to use a "programmer propeller" to act as a conduit from the ARM to the propeller that I would like to program...the "programmer propeller" would control the CTR line to control the reset and receive data from the ARM to program the final propeller chip.

Comments

  • T ChapT Chap Posts: 4,223
    edited 2015-05-26 08:52
    What is your ultimate goal here? Is the programming propeller going to be plugged in temporarily just for programming or it permanent. If permanent, seems like a bit of work just to program the other propeller. You should be able to program the ARM to reset the prop. Are you able to have other options to program the prop from pc/mac.
  • dr hydradr hydra Posts: 212
    edited 2015-05-26 09:08
    T Chap

    I think you are right...that is a lot of work to programmer one propeller...it is probably best just to create a full ARM to propeller programmer (CTR, TX, RX) lines. Is there a good source for the programming protocol for a propeller?
  • Heater.Heater. Posts: 21,230
    edited 2015-05-26 09:08
    Done already, multiple times.

    What we do on the Raspberry Pi, some other ARM boards and even embedded MIPS boards is use the Tx and Rx pins on a UART directly connected to a Propeller.The Propeller reset is connected to a spare GPIO pin.

    I made a customized loader to run on such ARM/MIPS boards that does this: https://github.com/ZiCog/pi-propeller-load

    The other loaders from prop-gcc and SimpleIDE/PropellerIDE should also be able to do this by now.

    Everything you need to know about the protocol is contained in this file https://github.com/ZiCog/pi-propeller-load/blob/master/src/PLoadLib.c
    In fact that file is a self contained Prop loader.
  • T ChapT Chap Posts: 4,223
    edited 2015-05-26 09:37
    The question still remains what is your ultimate goal here. Are you wanting a one time only prop programming method via PC/Mac/Linux. If so then why bother writing code for the ARM. There are simple methods. For example in the picture I made a Silabs CP2110 USB to UART that can connect to a board with a propeller for programming. That is why I am asking if you need the programming method to be built in or is it removed after the programming. The thing is, that since you will not likely be able to program your prop even with the ARM without connecting a PC or mac to the ARM to delivery the binary. So, why bother writing the code. I have a command line proploader for mac and pc for the Silabs chip. For that matter, programming VIA FT232 would be as easy using a breakout board with a plug to the prop.
    640 x 480 - 106K
  • Heater.Heater. Posts: 21,230
    edited 2015-05-26 09:50
    I cannot speak for dr hydra but I can imagine wanting to program a Prop from a Raspberry Pi or similar SBC.

    What if your Pi is at a remote location and it is using a Propeller to help with some real-time, real-world interfacing that Linux is not suited to. Effectively the code running on the Pi and the code running in the Prop are all part of the same application. So now, if you can load the Prop from the Pi you can remotely update both of them at the same time.

    Carrying that one stage further, if your Pi or whatever SBC is managed by a system like resin.io you can apply updates to many remote Pi/Prop pairs very easily. https://resin.io/
  • idbruceidbruce Posts: 6,197
    edited 2015-05-26 10:16
    dr hydra

    As mentioned, it would be nice to have specifics.

    Here is a Propeller chip programmer made from Prop DIP 40, without an ARM:

    attachment.php?attachmentid=114310&d=1432660441
    attachment.php?attachmentid=114311&d=1432660451
    attachment.php?attachmentid=114312&d=1432660462
    682 x 222 - 27K
    623 x 404 - 41K
    702 x 256 - 29K
  • dr hydradr hydra Posts: 212
    edited 2015-05-26 12:38
    First...thank you for all the replies...so, lately I have been using propellers that are on parallax development boards such as quickstart board and the protoboards...these boards already include the programmer based on the FTDI chip...which is great(just plug into the the laptop good to go). In the past, I had programed the propeller through the three transistor serial port protocal...which works good, but my curent laptop does not have a serial port...so instead of digging out an old computer to program my propeller dip chips, I have been looking at ways to program the propeller through the USB. I know I could just purchase a propclip, but for the same money I could buy a STM32F4 discovery...plus I found a program that creates a USB to UART bridge (virtual COM port) for the STM32F4...it can run PC <-USB->STM32F4<-UART->Propeller, but it does not inlcude a DTR line...so, I have been looking for (EASY) ways to use the STM32F4 as a propeller programmer:)
  • T ChapT Chap Posts: 4,223
    edited 2015-05-26 15:36
    Still not clear why you need to use another processor just to program the Prop, FT232 or Silabs USB>UART is about as easy as you can get.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2015-05-26 17:28
    "Using a propeller to program another propeller" - I think there is code in the obex dating right back to when the propeller first came out that can do this. Back then, I think the only storage was eeprom, but then along came SD driver code, so then it became possible to put a program on an SD card, then transfer that to a propeller or multiple propellers. The code is pretty simple as all the hard work as been done - ie read block of data from SD card, send block of data to other propeller.

    If the problem is the lack of a real serial port... Well it is great when you reach the stage in tinkering when it is time to design custom boards and build things differently. You can convert USB to serial for under $2 (search USB serial on ebay), but these use a chipset that is an emulation of the ft232 and it doesn't get it quite right with the dtr timing. Search instead 'usb serial ft232' and the adapters are more like $14, but there are cheaper ones coming out used for arduino that say they use the ft232 and which bring out pins on a header rather than a D9.

    Lots of solutions and all good fun to play around with!
  • TorTor Posts: 2,010
    edited 2015-05-27 00:09
    Chip has some code somewhere which programs a propeller from another propeller. Written in Spin IIRC. It's posted here somewhere and may be in obex too. Wait, I have some notes somewhere - "Propeller Loader v1.0" from June 13 2006.
    [google]
    Ok this exact question has come up before, the last time was as late as this February. This thread: Can a Prop program Another Prop [..] and msrobots included the code from Chip in post #6

    -Tor
  • DavidZemonDavidZemon Posts: 2,973
    edited 2015-05-27 06:15
    T Chap wrote: »
    Still not clear why you need to use another processor just to program the Prop, FT232 or Silabs USB>UART is about as easy as you can get.

    I think because he wants an excuse to buy another chip to play with :) Can't blame him there :P
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-05-27 06:22
    I have no idea about the aim here but I frequently program the eeproms directly rather than "program the Propeller" because that's all the Prop bootloader ends up doing. I2C single master code is trivial. Practically all my boards have the 4 pins for the Propplug plus another row of 4 pins next to it with the I2C bus and power so it's an easy matter to access the eeprom directly while holding it's Prop in reset if needed.
Sign In or Register to comment.