Page 1 of 1

FYP circuit

PostPosted: Sat Sep 05, 2009 7:53 pm
by decarus
i'm looking forward to build a robot with control of 10 servo motors and 4 dc motors(H-bridge). I was wondering what uC(PIC18F458 ???) do i need to make a servo controller that can control them.
Servo controller should be connected to a RF receiver and the RF transmitter is connected via a usb to a computer for control purposes using VB. Is it possible?

Re: FYP circuit

PostPosted: Wed Sep 09, 2009 11:53 am
by hyng
Your solution at http://blog.cytron.com.my/?p=6&cpage=1
Just that the wireless it use is Bluetooth or XBee
You need to make the modification on it.

Re: FYP circuit

PostPosted: Mon Sep 21, 2009 9:47 pm
by decarus
Tnx for your reply. What i've found is the PIC18F4550 which has USB support via the d+ and d- . Can i use Xbee for data transfer between that microcontroller and a computer and a USB camera attached to the microcontroller. So its like this

computer <--> X bee \\\\//// x bee <---> microcontroller <---USB camera

can gimme some example on how is it done.. tnx for the help xD

Re: FYP circuit

PostPosted: Tue Sep 22, 2009 2:13 am
by sich
PIC18F4550 has USB support but it cant act as USB host, so it cant control the USB camera since both are USB slaves. An alternative to add a camera to ur uChip, u can use CMUcam. http://www.cytron.com.my/viewProduct.php?pid=DiYsKxwjJxcuMyY8MRESDXvxj3tob8bWC1HFXPRTQRQ=&store=

Re: FYP circuit

PostPosted: Tue Sep 22, 2009 8:14 pm
by decarus
Ok.. I'll then stick back to the 18F458.
Lets say I have the camera. UART interface.. how do i make a wireless connection ?
Can it be like this

Computer <->USB-UART<-> X bee \/\/\/\/\/\ Xbee (Rx) <---- (Tx) Camera (Rx)-<-|
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\(RF Wireless) (Tx) ----> (Rx)PIC18F458(Tx)->-/

What i wanted is for the Xbee(on the microcontroller side) to only send image data and only receive instructions from the computer. So the flow is like this.
Computer send command through usb-uart -> Xbee --- Xbee --> PIC ---> Camera to start and after that a GUI is done on the computer to control the PIC for other functions(no feedback) LAter the camera send data directly to the Xbee --> Xbee--> UART-USB-->Computer for video streaming. Possible?

Pls advice if this is wrong xD I'm new in this

Re: FYP circuit

PostPosted: Tue Sep 22, 2009 8:18 pm
by decarus
Or is this possible?..lol

Computer-->Usb-UArt-->Xbee \/\/\/\/\/\ Xbee -->Uart-USB-->Camera(usb)

Both the Usb-uart and Xbee acts as only a terminal for data transfer.

Re: FYP circuit

PostPosted: Wed Sep 23, 2009 10:34 am
by sich
decarus WROTE:Computer <->USB-UART<-> X bee \/\/\/\/\/\ Xbee (Rx) <---- (Tx) Camera (Rx)-<-|
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\(RF Wireless) (Tx) ----> (Rx)PIC18F458(Tx)->-/

This maybe possible...can have a try.

decarus WROTE:Computer-->Usb-UArt-->Xbee \/\/\/\/\/\ Xbee -->Uart-USB-->Camera(usb)

Again, both are USB slaves. Uart-usb and camera cant communicate.

Re: FYP circuit

PostPosted: Thu Sep 24, 2009 2:51 am
by decarus
By doing so, then the instruction written must alter the Tx of the microcontroller to output start bit for the camera.

Which means, a GUI on the computer is sending data through the xbee to the microcontroller for both motor control and starting the camera.

So have to set a string(start command) on the microcontroller? How does the microcontroller know he'll have to send it to the Tx pin instead of i/o ports ?

Re: FYP circuit

PostPosted: Fri Sep 25, 2009 3:55 am
by decarus
How about this, Since both the camera and xbee are using uart, to get two uart ports, use two microcontroller and tunnel them using SPI interface. What do u think?

And can a 16bit uC tunnel with 8bit uC ?

Re: FYP circuit

PostPosted: Fri Sep 25, 2009 11:35 am
by sich
decarus WROTE:By doing so, then the instruction written must alter the Tx of the microcontroller to output start bit for the camera.

Which means, a GUI on the computer is sending data through the xbee to the microcontroller for both motor control and starting the camera.

Actually i'm not sure this is workable. You need to verify with the camera's communication protocol and do the testing.

decarus WROTE:So have to set a string(start command) on the microcontroller? How does the microcontroller know he'll have to send it to the Tx pin instead of i/o ports ?

You need to do some configuration in your program.

decarus WROTE:And can a 16bit uC tunnel with 8bit uC ?

Yes, as long as they 'speak' the same language. For example SPI, UART, I2C, CAN...

decarus WROTE:How about this, Since both the camera and xbee are using uart, to get two uart ports, use two microcontroller and tunnel them using SPI interface. What do u think?

It's easier to get a microcontroller with two UARTs. Some 16-bit PIC mcu has more than one uart. Besides, we also can add another software uart to a mcu with one hardware uart. Sample code can be obtained here: http://www.cytron.com.my/suppMaterial/18F_Sample_Program.zip
This source code uses Microchip C18 compiler and the mcu chosen is 18F4520. You can read more in SD02B User's Manual, Section 7.2 (page 26). Get the user's manual here: http://www.cytron.com.my/datasheet/SD02B_User's_Manual.pdf