Propeller1 connection to PC via USB

Hi,
I would like to connect the P8X32A to PC for main control via USB. I think I need USB to serial conversion IC like the FT232. I have no SW practice how set up the HW and build up the communication. I have found some sample program in the internet but not fully cover my needs. Can any body give me advice or share me this kind of program?
Best Regards
Spiller

Comments

  • yetiyeti Posts: 587
    edited 2019-08-29 - 08:47:18
    Propeller-Demo-Board-Schematic-RevG_0.pdf shows a Propeller to FT232 connection, p1load, PropLoader and several other loaders do exist to send your code to the Propeller and play terminal afterwards.
    ◁ propeller-wiki ▷ ◁ FastSpin ▷ ◁ Help Spin at RosettaCode.org ▷ ◁ No Source – No Go! ▷ ◁ DK-E ▷ ◁ :-D ▷ ◁ Stay OmmmmmmPtimistic! ▷ ◁ Why Asimov's Laws of Robotics Don't Work ▷ ◁ DNA is a four letter word. ▷ ◁ Stop slavery! Free all mitochondria! ▷
  • HI Yeti,
    Thx the info. After my understanding if I use one of these loaders I can communicate (send/receive data) to the propeller in USB connection from a PC?
    Regards
    Spiller
  • Spiller wrote: »
    HI Yeti,
    Thx the info. After my understanding if I use one of these loaders I can communicate (send/receive data) to the propeller in USB connection from a PC?
    Regards
    Spiller

    As long as the software you download to the Prop includes a serial comms object that is set up to communicate on pins 30/31 the PC and Prop can communicate.
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • Hi,

    So I can use the same propeller ports for USB communication as for programming the propeller? Can I modify this serial comms object to use other ports?
    Regards
    Spiller
  • yetiyeti Posts: 587
    edited 2019-08-29 - 13:52:29
    The Propeller contains a serial loader in its ROM. After loading your program, this loader gets completely out of the way. Your program needs to manage the communication with the PC. There are plenty of examples for this. A very simple "Hello, World!" in Spin could look like this:
    con
      _clkmode = xtal1+pll16x
      _clkfreq = 80_000_000
    
    obj
      ser : "FullDuplexSerial"
    
    pub main
      ser.start(31, 30, 0, 115200)
      ser.str(string("Hello, OpenSpin!",13,10))
      waitcnt(_clkfreq + cnt)
      ser.stop
    

    Changing the arguments in "ser.start", you can change the pins and the speed.
    ◁ propeller-wiki ▷ ◁ FastSpin ▷ ◁ Help Spin at RosettaCode.org ▷ ◁ No Source – No Go! ▷ ◁ DK-E ▷ ◁ :-D ▷ ◁ Stay OmmmmmmPtimistic! ▷ ◁ Why Asimov's Laws of Robotics Don't Work ▷ ◁ DNA is a four letter word. ▷ ◁ Stop slavery! Free all mitochondria! ▷
  • kwinnkwinn Posts: 8,329
    edited 2019-08-29 - 18:14:46
    Spiller wrote: »
    Hi,

    So I can use the same propeller ports for USB communication as for programming the propeller? Can I modify this serial comms object to use other ports?
    Regards
    Spiller

    Short answer is yes. The line of code "ser.start(31, 30, 0, 115200)" in yeti's post above sets the serial object code to use pins 31 and 30. Any other two pins could be used for communicating with the outside world, but only 31 and 30 can be used for booting the Propeller via serial download.

    There is also a 4 port object that can be used to enable four serial ports, each of which can run at different speeds and pins. I have used that object to build 8 and 12 port serial concentrators for laboratory and automation equipment.
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • Hi All,
    I more than satisfied with these answers. I will try these codes. Thanks for both of you! Spiller
Sign In or Register to comment.