Shop OBEX P1 Docs P2 Docs Learn Events
Rs232 propellor boot up, reset pin — Parallax Forums

Rs232 propellor boot up, reset pin

TransistorToasterTransistorToaster Posts: 149
edited 2007-02-19 04:22 in Propeller 1
Hello,
i would like to know more about the propellor boot up because I like to use the P31 and P30 pins to communicate with the PC and also I am debating whether or not I make the Propellor reset regularly with the reset pin. I would like to know the exact mechanism of the detection of the PC's presence by the Propellor as briefly summarized on p18 of the propellor manual WebPm-v1.01.pdf

2. The Boot Loader performs one or more of the following tasks, in order: a. Detects communication from a host, such as a PC, on pins P30 and P31. If communication from a host is detected, the Boot Loader converses with the host to identify the Propeller chip and possibly download a program into Main RAM and optionally into an external 32 KB EEPROM.
---


The context of my question comes from the fact that i am porting some code from another microcontroller that uses RS232 and the DTR line which is connected to the MCU reset pin. To ensure that the MCU is synchronized with the PC, I make the PC pulse the DTR line which resets the MCU and forces it at a know startup state. Now, I don't know yet if this is efficient with the Propellor for my particular application. What I like to know are what kind of characters and tests on the serial pins the Propellor does at its power up.
Thanks,
Frank

Comments

  • TransistorToasterTransistorToaster Posts: 149
    edited 2007-02-18 20:37
    Also, I would like to know the Propellor's baudrate at powerup.
    Thanks,
    Frank
  • bassmasterbassmaster Posts: 181
    edited 2007-02-18 21:19
    here is the ide baud


    3:16:14 PM Propeller.exe IOCTL_SERIAL_SET_BAUD_RATE VCP0 SUCCESS Rate: 115200
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-18 22:06
    The Baud rate is a little misleading. The PC and Propeller actually communicate using the 8 bit characters codes as either one bit per character or 3 bits per character using what's called a ratiometric technique. Essentially, counting the start bit, you have 9 bits per character frame and the 3 "cells" of 3 bits each are encoded either as %011 or %001. I think that two zero bits in a cell are a one bit of data and one zero bit in a cell is a zero bit of data. This is all to avoid having to do absolute timing. The first bit sets the cell width and you either have a 1:2 or 2:1 ratio of zero level and one level information. The Propeller initially runs off its internal RC oscillator, may not actually have a crystal or resonator attached, and the internal RC oscillator may vary all over the place in frequency (long term - it's pretty good short term).
  • TransistorToasterTransistorToaster Posts: 149
    edited 2007-02-18 23:19
    Mike,
    Thanks for the response. The reason why I am asking this is to figure out if I can recycle the P31 P30 pins for my own personal communication after power up. I am not 100% sure if I understand correctly. Are you saying that each data bit is signalled with a error corecting code of three bits (001 or 011)on the serial line?
  • TransistorToasterTransistorToaster Posts: 149
    edited 2007-02-18 23:21
    Mike,
    It's when you say "either one bit per character or 3 bits per character", I am not catching totally.
    Frank
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-02-18 23:35
    Yes you can use the two lines for your own communications, either your own circuitry or the USB connection. You cannot mess with the DTR line because that is the means by which the Propeller becomes aware the Tool is communication with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2007-02-19 04:22
    If after the DTR pulse, you leave the tx line into the Propeller (pin p31) low, the bootloader will conclude within 0.1 second that the serial line will not be supplying the data. It will then take about 1.5 seconds to load code from eeprom and start the interpreter running on your Spin program. Your Spin program could then send a handshake "ready" out to your external device in order to initiate your other communications. That would synchronize the operation, but the 1.5 seconds might be too long.

    It might be easier to have a cog monitor the serial port for activity. Forego the DTR pulse. The activity could be a specific character, or simply a level change. If the Propeller will be resting at RCslow, then a level change on the serial input at p31 could can induce the Prop to gear up to full speed much faster than 1.5 seconds.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.