Shop OBEX P1 Docs P2 Docs Learn Events
Why Program runs only when USB attached?-(Solved) — Parallax Forums

Why Program runs only when USB attached?-(Solved)

msiriwardenamsiriwardena Posts: 301
edited 2019-03-16 11:54 in Learn with BlocklyProp
I have a program in a Propeller Proto board that only runs with USB cable attached but
after it starts working I can detach the USB cable it continues to run but if I power down
and re-starts it will not work until I attach the USB cable, and I don't have to do anything
the program starts to work. The program is in the EEPROM.
In other words I always have to get the program working before I could move the set up.

This is the Transmission board for the Activity Bot.
I have public link to the program also.
Attach is the screen shot of the program.

I like the program to run without the jump start.

Thank you.

Siri

1920 x 1080 - 220K

Comments

  • PublisonPublison Posts: 12,366
    edited 2019-03-15 17:54
    How are you powering your Proto Board? It will take more power with the XBEE attached.

    Picture would help.
  • msiriwardenamsiriwardena Posts: 301
    edited 2019-03-15 18:58
    @Publison
    At the moment I am powering with 7.7V via a brick 700mA .

    Finally I will power with a 5x1.5 battery pack.
    I have only 5 way switch, XBee S2C and a LED to indicate Transmission.
    The program runs on its own after the jump start with no USB.

    Siri
  • PublisonPublison Posts: 12,366
    edited 2019-03-15 19:06
    Are you using the "Down Arrow" to load and save to EEPROM from Blockly?
  • @Publison

    Since you ? the power supply I tried wih a
    7.5V 12Watt power supply and the issue remains.

    Siri
  • msiriwardenamsiriwardena Posts: 301
    edited 2019-03-15 19:23
    @Publison

    Yes I am using the "down arrow" to the EEPROM and not to the RAM.

    I have attached a picture of the setup.

    Siri
    3024 x 4032 - 4M
  • The line "if Button Press = 31" may interfere with the USB interface as that is a programming port. Change that to a lower pin and see what happens.
  • PublisonPublison Posts: 12,366
    edited 2019-03-15 19:38
    @Publison

    Yes I am using the "down arrow" to the EEPROM and not to the RAM.

    I have attached a picture of the setup.

    Siri

    I can't quite see where the pushbutton is attached to. Which Pin? Picture of the bottom of the board please.
  • @Publison

    Here is the back of the board.

    Siri
    3024 x 4032 - 4M
  • Looks like button is connected to 21 not 31?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2019-03-15 20:49
    Add a pull-up resistor to Vdd (~2.2K) to your Tx line (P30), and I think the problem will go away. What's happening is that the Propeller is parasitically powering the USB chip when Tx raises, which causes the USB chip to reset the Prop in an endless cycle. The pull-up will keep the USB chip powered all the time, eliminating the edges that cause the reset.

    -Phil
  • @Publison

    The button is connected to pins 18 ..22.


    Siri
  • I'll have to ask again. Is the line "if Button Press = 31" correct. That is the pin for the communications port, (USB). Should that be 21?
  • @Publison

    The "if Button Press = 31" is the decimal interpretation of the "center position" of the 5 position switch.
    Yes it happens to be the number of the communication pin. There has nothing connected to that pin.
    Just using the number 31 should not have any effect.

    Siri
  • @"Phil Pilgrim"

    I will try your solution tomorrow morning.

    Thanks for the help

    Siri
  • Cluso99Cluso99 Posts: 18,069
    edited 2019-03-16 09:48
    As Phil said, the problem is with the propellr powering the usb chip form its serial pins. This is a well known problem.

    You can try in your code making sure you dont use the serial pins (P30 & P31) and make them inputs.
  • @"Phil Pilgrim (PhiPi)" ,@Cluso99

    Thank you for rational explanation and the fix worked
    as you expected.

    Regards,

    Siri
  • @Publison

    The "if Button Press = 31" is the decimal interpretation of the "center position" of the 5 position switch.
    Yes it happens to be the number of the communication pin. There has nothing connected to that pin.
    Just using the number 31 should not have any effect.

    Siri

    Glad you go it worked out. I have to say I have not spent enough time in Blockly to realize that it was looking for a value instead of a pin number. I apologize.
Sign In or Register to comment.