Shop OBEX P1 Docs P2 Docs Learn Events
Difference between power cycle and F7 in Prop Tool — Parallax Forums

Difference between power cycle and F7 in Prop Tool

Paul MPaul M Posts: 95
edited 2010-03-10 11:23 in Propeller 1
What is the difference between power cycling the prop and doing an "identify hardware" (F7) in the propeller·tool?

The reason I ask is that I am having problems with an I2C device:

1. I download the code to EEPROM using F11 - everything works
2. I power cycle and the device stops resonding altogether
3. I do an F7 and the device start working again.

Any ideas?

Paul

Comments

  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-03-09 16:01
    Idle musing, but ...

    I have had the same, or simular, thing with the Prop. On one of my attemps of DracBlade the unit would chuck out an error when powered on but never on a reset button push, or any of the F7,8,9,... resets.

    Over the last weekend I was playing with some bi-lateral swithes to put a KBD onto the boot EEPROM's lines. It was to switch the boot EEPROM out at the first drop of the KBD clock line P27 (I think). It didn't work out as expected from power up, as the P27 was dropped,·at a low impedance, before the·EEPROM had finished dumping, and therefore before the Prop should have started·. Again the same thing didn't happen from resets.

    (I then thought about it and found that the start of H sync was a reliable signal to use, that is still on P17 and didn't glitch, although it is low to start with I havent seen any evidence of it becoming low-Z, before becoming active.)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point

    Post Edited (Toby Seckshund) : 3/9/2010 4:26:28 PM GMT
  • David CarrierDavid Carrier Posts: 294
    edited 2010-03-09 18:36
    Paul and Toby,
    When the Propeller boots (or reboots) all registers are in a known state, except the system counter. On cold boots, the counter will generally be a similar value every boot, but with resets it tends to vary by significantly more. Try waiting up to a minute after resetting the Propeller to see if your program magically starts running. If so, then you probably have a waitcnt instruction that is looking for an absolute cnt value.

    — David Carrier
    Parallax Inc.
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-03-09 20:03
    Could someone tell me where it's usefull to wait for a constant cnt value????
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-03-09 20:19
    I did find that holding the reset low for a second or so, from power on, got around both of my problems. I just suspected that as the Prop does look to the serial, for a PC, and then to the EEPROM lines, that it was looking for another thing on P27+P26. That or it was still shuddering from being woken up.

    I have yet to try these things from a battery source, rather than the SMPSUs I usually have.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-03-09 21:27
    Paul,

    Your I2C device probably requires a longer time to come out of reset after power-up than you're allowing it. Try putting a delay at the beginning of your program before trying to access it.

    -Phil
  • kuronekokuroneko Posts: 3,623
    edited 2010-03-09 23:56
    MagIO2 said...
    Could someone tell me where it's usefull to wait for a constant cnt value????
    Sync'ing cogs for example. Although there are other ways (besides waitpxx).
  • Paul MPaul M Posts: 95
    edited 2010-03-10 11:23
    Thanks for the replies.

    Phil, there is a delay of 100ms -changing this to several seconds makes no·difference.

    David, the program starts running as expected, output is sent to the serial port for example, it is just that the connected·device responds differently.·Your answer indicates that the I/O pins are in the same state for a RES or Power cycle so this behaviour is·unlikely to be caused·by the propeller.

    I've done some more testing and I am now suspecting that it is the I2C device itself (a pressure sensor in this case) that is the cause of the strange behaviour. Obviously a RES does not power down the device which then seems to latch into a "different" state. I am in discussions with the manufacturer and will let you know the outcome.

    Paul
Sign In or Register to comment.