Page 1 of 2
Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Fri Nov 23, 2012 2:40 pm
by momokui
From the servo controller, I have connected a USB to UART to my laptop. My aim is to construct a C program to send the data from my laptop to the controller to turn the motor. The motor I'm using is servo motor. However, the sample code 'SK40C_16F877A_SC08A.c' provided, the servo controller is connecting to another microcontroller, but in my case, I connect it directly to my laptop.
As I know, SC08A send a command with 4 bytes of data. (1st byte=mode and servo motor channel, 2nd and 3rd byte=servo position, 4th byte=speed of motor). How am I going to send the 4 bytes of data? In other words, how am I activate the USB to UART to pass the data to the controller?
Appreciate much for the help.
Thank you.
Re: Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Fri Nov 23, 2012 3:42 pm
by gadgetng
You didn't tell us what software you used in your computer.
i used SC08A before but with the microcontroller. Isn't there is a VB GUI given by Cytron? Why don't you just use VB ?
Re: Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Fri Nov 23, 2012 5:02 pm
by momokui
Ya, Cytron is providing the GUI software. However, I'm using Code block to execute my codes, so it must be written in C language instead off VB.
Re: Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Fri Nov 23, 2012 5:28 pm
by gadgetng
code block? gain my knowledge again
sorry can't help you much.. never use code block before.
Anyway, i believe that serial port programming is what you are looking for. Like VB, you need to know how to open, read/write and close the comport.
Re: Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Fri Nov 23, 2012 5:56 pm
by momokui
It's ok, thanks for the advice. Till now, I'm able to open the COM port, just that I do not know how to read and write the data using USB to UART.
Re: Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Fri Nov 23, 2012 7:58 pm
by robosang
never heard code block before too, but agreed with gadgetng.....COM port is very common in programing, take sometime to go through some sample code.
Re: Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Fri Nov 23, 2012 11:17 pm
by zhenning
momokui WROTE:Ya, Cytron is providing the GUI software. However, I'm using Code block to execute my codes, so it must be written in C language instead off VB.
Hmmm...seems to me code block is just another ide just like eclipse. The serial programming greatly depends on whether you are using win or linux os.
Take a look at this:
www.robbayer.com/files/serial-win.pdf and
http://www.lafn.org/~dave/linux/Serial- ... OWTO-B.txt
Re: Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Sat Nov 24, 2012 4:22 pm
by momokui
Thanks zhenming..
Re: Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Sun Nov 25, 2012 11:39 pm
by momokui
I was trying to sending data from my laptop to the controller via USB to UART. In my case, the Tx pin is lighted on, I guess it indicates the data is being sent. My question is, how does the servo controller notify the user that the data is being received?
Thank you.
Re: Problem Faced in 8 Channel Servo Controller (SC08A)

Posted:
Mon Nov 26, 2012 2:00 pm
by gadgetng
momokui WROTE:I was trying to sending data from my laptop to the controller via USB to UART. In my case, the Tx pin is lighted on, I guess it indicates the data is being sent. My question is, how does the servo controller notify the user that the data is being received?
Thank you.
The UM didn't mention?