Shop OBEX P1 Docs P2 Docs Learn Events
RCFast and serial to Prop Tool? — Parallax Forums

RCFast and serial to Prop Tool?

prof_brainoprof_braino Posts: 4,313
edited 2011-08-04 09:43 in Propeller 1
I don't if I have this thought out correctly. I want to know if I can run the prop with no external crystal, thus saving the cost of a part for a little while, and still program the prop's EEPROM, and talk to it using 57600 baud terminal program. This is my guess:

For EEPROM: Both RCFast and RCSlow, we can program the EEPROM, because the EEPROM is controlled by the prop, so it doesn't really care how slow it is.

For serial terminal communications: RCFast at 12Mhz should be fine. RCSlow at 20Khz is too slow for 57,600 baud. The terminal baud rate would have to be less than 20Khz, so 19,200 or 9600 would be OK.

Have I got this right?

Comments

  • LeonLeon Posts: 7,620
    edited 2011-08-02 10:47
    You might be able to use RCfast by measuring the value and adjusting your software to suit. See page 30 of the data sheet. I'd use a crystal, though.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-08-02 10:47
    I've wondered about communicating with rcfast or rcslow and a terminal program. I think the Prop would need to listen to the com line for a while and measure the pulses coming in. Is a person repeatedly pressed "U" (I think the ASCII code has a nice pattern) then the Prop could determine the appropriate baud rate. The new baud rate could then be used for full duplex communication. I don't know how slow the baud setting should be on the serial terminal though.

    Another alternative would be to accurately measure the rcfast or rcslow and use the measurement to compute the appropriate baud rate.

    I think you want the baud rate to be much slower than the clock speed. At 80MHz I think the baud is limited to around 1Mbps. So if rcslow is 20KHz then you'd probably want a target baud of 300bps.

    Duane
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-08-02 10:57
    I'm not sure the $1.10 saved is worth the hassle or loss of features. It's a 2 pin part that connects to 2 pins on the prop. I'm not sure if it can get damaged if hooked up wrong - I don't know if crystals have magic smoke inside or not.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-02 11:00
    Duane, You could probably get away with what you suggest (calibrating RCFAST). The clock speed ought to be stable over a period of minutes, possibly over hours once the chip has stabilized thermally as long as the Prop is using a regulated supply with good bypassing. By using the incoming serial stream as a calibration source and recalibrating whenever bytes come in, the Prop should even manage as temperatures shift slowly. You'd need a relatively sophisticated method to extract the timing from an arbitrary input stream since you could have multiple bits of the same value being adjacent. You'd need to measure the width of zero pulses and look for the closest multiple (from 1 to 9), maybe average several readings before changing the CLKFREQ value and the serial I/O timing.
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-08-02 12:46
    Leon wrote: »
    You might be able to use RCfast by measuring the value and adjusting your software to suit. See page 30 of the data sheet. I'd use a crystal, though.

    So by this, I think you mean Table 1-10 of the propeller manual; and it shows that the values for RCFast and RCSlow can vary a large amount. (from temperature?). So the prop won't necessarily know what speed its running at, and would have to determine some appropriate relative baud rate value based on the remote.
    repeatedly pressed "U" (I think the ASCII code has a nice pattern) then the Prop could determine the appropriate baud rate.

    I have this Harris RTX2000 board that does nifty autobaud detection. Type a character and by the end of the character is has already set the baud to the terminal speed. Period "." works well. I think I remember something about counting and timing the transistions allows it to detect allows it to determine all the serial settings in one character. If it doesn't figure out the setting, hit reset and try another character.
    not sure the $1.10 saved is worth the hassle or loss of features.

    Yes, this is what I'm looking at. But there a LOT of boy scouts, so it could mean a pile of dollars. And they can always buy one later when it becomes a requirement for an application.
    clock speed ought to be stable over a period of minutes ... measure the width of zero pulses and look for the closest multiple (from 1 to 9)

    I think RTX2000 did something like this. To keep things simple, it was only done at start up. If it ever does drift to the point communications get messy, we just hit reset. I never noticed it get lost and need a reset, but I tend to reset often during development anyway.

    So the answer is: The issue is variance in prop's internal clock. It might be possible for a prop running from RCFast or RCSlow to talk to a serial terminal, but the software would have to do autobaud detection, and the communications might get garbled due to internal clock drift. Running in this fashion may require reseting the prop if temperature changes the internal clock speed after detection.

    Thanks guys! I think I have a handle on this now.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-08-02 18:25
    Actually the xtal is more like 50c. In fact, because I socket the xtal, this adds 50c which of course could be deleted in this project. So my advice is to keep the xtal.

    The eeprom could be added later provided the space for t/hole is made. Alternately, 32KB could be provided which reduces cost.
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-08-04 02:35
    Running in this fashion may require reseting the prop if temperature changes the internal clock speed after detection.
    In my tests and observations which are short term, the temperature changes are slow over time given the conditions in the lab here once a "warmup" stability is reached. If you implement a periodic check and run within a specified time frame communications should be doable without resets.
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-08-04 06:27
    Humanoido wrote: »
    the temperature changes are slow over time given the conditions in the lab here once a "warmup" stability is reached.

    An idea how slow ovrer how much time? For example, with ambient temp 20C, after 2 hours the prop reaches 24C?

    An idea of how much of a change in temperature is needed to cause a measureable change in clock speed?

    I think during development, I'll be reloading or reseting the prop several times and hour, and after development the temp will be stable itf the ambient is stable.
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2011-08-04 09:43
    According to the P32X8 data sheet v1.2, section 10.1, the temperature coefficient from 0°C to 50°C is about 0.4% per °C. So, over that two hour period with a change of 4°C, expect a 1.6% change in frequency. (Your results may vary!). Note that the graph is normalized to the frequency measured at 25°C. The text that accompanies the graph states that the absolute frequency at 25°C ranged from 13.26 to 13.75 MHz, but it doesn't say how many are in the sample, and there are no error bars on the graph (grrrr!)

    An idea how slow ovrer how much time? For example, with ambient temp 20C, after 2 hours the prop reaches 24C?

    An idea of how much of a change in temperature is needed to cause a measureable change in clock speed?
Sign In or Register to comment.