Shop OBEX P1 Docs P2 Docs Learn Events
Beside Basic Stamp? — Parallax Forums

Beside Basic Stamp?

NickLeeNickLee Posts: 6
edited 2005-10-13 16:08 in Robotics
Hi,

i new to here and now currently doing a project which deal with many servo motors. and hoping to use the parallax serial servo controller (16) to control all the servos, could i know beside using the basic stamp as the host, can i use the other micro controller to control it? such as PIC micro controller?
thanks and hope to hear from u all soon.

regards
lee

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-10 13:30
    You can use any microcontroller capable of generating the proper serial signals -- open true. That means the serial line is only driven low (for a 1 bit) and pulled high·(with a pull-up) for zero and stop bits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-10-10 14:19
    Yup, any PIC can do this, as long as it's programming language supports some form of SEROUT -- basically, a software UART. And most PIC programming environments do support this. In fact, I believe the SX28 environment Parallax supports will do this, also. And for $10.00 you can buy the SX and a prototyping area. The programming environment for this costs $100, but that's a one-time cost.

    And the SX52 cycles at 50 MHz. Sweet!
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-10 14:23
    You can push most SX chips to 75 -- we even have 75 MHz oscillator modules in stock that fit on the proto boards.

    And if one goes with the SX, the SX/B is at the ready and will handle OT serial modes with no trouble.· If you look at the Serial Inkjet Printer project I posted in this forum you'll see that I'm using that to communicate with a BASIC Stamp host.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • NickLeeNickLee Posts: 6
    edited 2005-10-10 16:01
    thanks for your answer,

    so, is it mean that i can use the serial uart protocol in the PIC to control the servo controller? aand just sending the data serially to the controller?
    but, is there any example, coz i saw most of the sample program use the basic stamp language, by the way, if i'm using the c language or the PIC assembly language, how is the protocol to control the servo controller?

    thanks again and hope to hear from u all soon.

    regards
    lee
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2005-10-10 16:16
    Lee, that depends on the controller. The protocol on the servo controller end doesn't change-

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • NickLeeNickLee Posts: 6
    edited 2005-10-10 16:31
    thanks,

    i using PIC16F877A, is it ok?

    but how is the protocol if i'm wriying in assembly language?
    can u all give me some idea?

    thanks to u all!


    regards
    lee
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2005-10-10 16:43
    The protocol for talking to the PSCs are in the docs for the serial PSC. That won't change. What changes is HOW you implement that protocol. The only limitation is your ability to send serial data from your controller.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • NickLeeNickLee Posts: 6
    edited 2005-10-10 16:57
    ok, thanks

    so u mean i need to send '!SC' first and ended with 'CR' for each command? eg: here is my sample prog:
    MOVLW '!'
    CALL SERTX
    MOVLW 'S'
    CALL SERTX
    MOVLW 'C'
    CALL SERTX


    MOVLW 0x0D
    CALL SERTX

    besides that, i shall also set the VER? command and the baudrate SBR command to the servo controller also? really blur now, coz this is my first time using the PIC micro controller and the servo controller as well.

    could u all help me?

    thanks

    regards
    lee
  • Tom WalkerTom Walker Posts: 509
    edited 2005-10-10 17:38
    NickLee,
    While there are probably several on this forum who are experienced with the intricacies of serial communication using a PIC, this forum is really intended to focus on using Parallax products for control. There are several lists that deal with PIC specifics.

    And to answer your other question, yes, it is as simple as sending the "!SC..." string to the PSC, via whatever controller you happen to be using...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-10 23:35
    Since the PIC is using a hardware UART you'll need to connect the TX and RX pins (with a resistor -- not directly) so that you can transmit to and receive from the PSC with one line. If you can disconnect the TX line after transmitting (make it Hi-Z) that will prevent it from interfering with the transmission back from the PSC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-10-10 23:45
    And what Jon means by "Hi-Z" is aka High Impedance is aka "make it an Input".

    Making a PIC pin an input disconnects the output drivers from that pin -- thereby rendering it a high-impedance pin.

    <end pedantic mode>
  • NickLeeNickLee Posts: 6
    edited 2005-10-10 23:59
    thanks again,

    is it mean that the PSC will have a reply signal each time i send data to it? can i just send the data to it without need the PSc to reply?
    by the way, need to be very confirm that the souce code i write previously is correct? and is it a must for me to send the VER command and the SBR command to the PSC?

    hope u can help me. thanks again.

    regards
    lee
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-11 19:19
    We (Parallax) don't use that PIC here so you'll need to get someone else to confirm you source code (perhaps another forum member). As far as responses, you'll want to read the docs and see which commands reply. To be safe, you could simply mimic the OT mode of the BASIC Stamp which leaves the pin in a Hi-Z (input) state after any transmission.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • NickLeeNickLee Posts: 6
    edited 2005-10-13 15:39
    ok thanks to all your help and advice.

    i'll try and see first, and will seek for more advices if needed, ok?
    hope u all can help me in the future.

    thanks again.


    regards
    lee
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-13 16:08
    If you make the swtich the SX micro, I can give you lots of help! tongue.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.