Shop OBEX P1 Docs P2 Docs Learn Events
Controlling the PSC with a PIC? — Parallax Forums

Controlling the PSC with a PIC?

almasrialmasri Posts: 2
edited 2005-11-09 08:31 in General Discussion
Hi,
·i want to control 12 servo motors using a PIC16F877A, the only servo card i found and i bought was the (parallax servo controller), i have connected the servo controller to the PIC board using an RS232 cable, now i have to send signals to the Servo board to get the motors starting:
according to their manual
Each position command is comprised
of a header, three parameters: C, R, and PW, and a command terminator.
The Header: “!SC” is the header. The header signifies to all devices on the same wire that this is a command for a Servo Controller.
if i want to pass it to the PIC i have to USe PUTC() is that correct..??
and how can i pass a command which is readable by the servo controller such as the !SC...???

did anybody ever came across this controller and is it possible to provide me with a simple example, i am using a software that came with the PIC called PCW C compiler

you can tell i m a beginner
thank you very MUCH

Post Edited By Moderator (Jon Williams (Parallax)) : 11/7/2005 9:46:51 PM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-11-08 00:43
    Not sure what you're asking...The answer is there.· You need to send ASCII bytes "!SC" followed by the binary data for the values, followed by a CR (Carriage Return).·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-11-08 14:45
    It is always awkward when a customer wants to combine two products from different vendors. Microchip products have several user groups for PICs.

    When you get to the PUTC(), you should be asking someone that programs in C.
    Parrallax Products are supported by PBASIC, SX/B Basic, and SX-Key Assembler. Sorry, no C at this time.

    The Servoboard is really an ASCII code string that controls it. So mixing products should easily work.
    If you really want to simply test the board, you probably can connect your Servo Board to your personal computer via the RS-232 and use hyper-terminal to send the commands and observe the motion.

    At least you can make sure you have the board functioning properly. Then, you can move on the PIC world.
    Above all Parallax is happy to make sure you got a functioning product and your moneys worth, but they cannot be all things to all customers.

    Regarding programing a PIC in C compiler, I personally have no idea of what is required. I do know that the you have a UART on that PIC. You have to properly intialize it and write some code to output. If you want to have sensors create the output, you need to do more programing. Seems like you are in need of a good book. Try www.nutsvolts.com for books on the PIC. There is a Mike P.... that has written a lot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Tom WalkerTom Walker Posts: 509
    edited 2005-11-08 15:02
    Kramer,
    Myke Predko is the name you're referring to and he is, indeed, one of the most prolific writers on the PIC that I have seen.

    Almasri,
    It sounds like you don't really have a grasp of programming in C. I would recommend getting a handle on that first. If you have the hardware required to program the PIC, working with the PSC should not be a problem once you grasp the basics of C. Even without a hardware UART, most C compilers implement a software UART via library.

    Good Luck!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-08 15:50
    To Tom's point, Myke Predko·has a neat book called 123 PIC Microcontroller Projects for the Evil Genius.· A large portion of the programs use PICC, and there are even a few experiments that interface small PICs to a BS2.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • almasrialmasri Posts: 2
    edited 2005-11-08 19:47
    thanks a lot Guys
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-11-09 08:31
    If you can't handle learning C [noparse][[/noparse]I cannot seem to grasp it], you surely will find PBASIC a good entry point. But of course, that means switching your microprocessor platform too.

    If you want to write Assembler to the PIC, it is nearly the same as the SX-Ubicom and it might be easier to learn first via the SX-Ubicom as there are not the diverse inventory of hardware. Nearly everything is done in software instead. Parallax has always provided more support on the education side.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Sign In or Register to comment.