I am using 13213 SRB. The board has only USB serial interface. I need to connect it to a RS232 serial device. Can I do it using a USB to RS232 converter? If so how should I wire two male USB connectors?
Added p/n to subject.
I don't think that you will get success.Because you only have a usb port on your IC. It is not a Uart. The usb want to connect to other device which must be PC must base firmwre on a IC and loaded a driver on PC for your communication of IC. On the other hand, your RS232 may work well with other devices with rs232. Because of Rs232 work well without a special firmare driver,which may include USB Stack, USB CDC,etc.There are two communication wire cable in RS232 protocol. They are RX and Tx. Could you understand what i worte?
Your design won't work in fact.
There is an USB port on the board, but the MCU doesn't have USB !! Have a look at the schematic of the board (http://www.freescale.com/files/rf_if/doc/ref_manual/MC1321xEVKRM.pdf ; page 30). If it is the board you are using, the USB is used by a USB to Serial Converter, but of course you can't make a Serial to USB to Serial converter !!
You have only one solution : using SCI1, the pins are PTE0 and PTE1, I see that there are on test points ...
Thanks for reply
Yes this is exactly the board I am using. Assuming That I want to connect the board to a RS232 device I should connect PTE0/TxD1(TP131) to RXD(pin 2) of the device, PTE1/RxD1(TP132) to TX(pin 3) of the device, ground of the board to ground of the device(pin 5). What about other pins (4,6,7,8) if hardware handshaking is implemented?
You're right. Don't forget to use a RS232 transceiver if the device you want to connect works with RS232 levels (and not TTL levels).
To use hardware handshaking, you will have to implement it in your software, and you will have to use some standard GPIO. You will also need to connect those lines to a transceiver.
I am using the same board and I was looking at the schematics (page 30 of the pdf file) and realized that the RX2/TX2 pins that are in J103 (Table 4-4 page 28) don't go directly to the usb convertor. So, you think that if I use the pins (15 and 16) that are in J103 conector would make it? This is beacause a just can't find where can I take the TX1 and RX1 connections.
Another question, by RS-232 transceiver you meant something like a MAX232?
I never had use SCI over a Freescale MCU but I had used it on Pic's and the only thing that I had to do was connect TX, RX and GROUND pins of a USB-RS232 cable to a MAX232 (with the right capacitors obviously) and then I just used the RX and TX connections of the PIC with the TX and RX pins of the MAX respectively and that did it.
Hope you guys can help me, I am in the middle of a Robotics project and the only way that I can achieve Wireless connection is via 1321x-SRB BeeKit.
I´m now playing with my protoboard using UART.
I suppose most of MCUs has 2 UART channels, you can use whatever you like ... ch1 or ch2. In the init process you will define the channel.
Processor Expert makes very easy to use the UART. As it provides you with some functions to read and write.
It´s very easy, just connect MCU´s Tx pin to the Rx pin of the "other side" (receiver). And MCU´s Rx pin to the Tx of the PC, robot, anything.
With that you have a fantastic Serial communication done. All the rest is software.
RS232 transceiver will need MAX232 or similar to adapt the line voltages. In the case of USB (Virtual COM) there is no needed of that, cause chips like FT232 or TUSB can be connected directly to the MCU.
Datasheet of the FT232R brings different examples and one of them show how to connect it with a MAX232.
What is the other "handshaking" pins. Well, I´m not using it. For what I know handshaking pins are needed when you are sharing the lines (Tx,RX) with three or more devices. So you can tell when the line is busy and free.
I have read somewhere in this post that Channel 1 of the UART is connected to the USB. That means if you are going to use the USB (with Serial COM) with another device connected to the same channel plus the MCU THEN you need handshaking (three devices speaking in the line).
But if you are going to make Point to Point communication there is no needed to connect any of the handshaking pins. Leave unconnected.
In the MCU whenever something enters in the buffers an interrupt request will enter and wake up the MCU.
In PC for example, the SO has an automatic buffer reception implemented.
To Know when it has finish the transmission it depends of the application, but with some aspirines and software you can go with it without problem.
Remember that UART knows when a character has been received. UART doesn´t know nothing about Strings, only characters. The IRQ of the MCU will automatically save your characters in a buffer. and you can get the string from there.
From the handshaking I don´t know much more. I don´t know why in a point to point protocol handshaking should be used. I think there is no needed of that because or redundance. Someone knows more about this?
Retrieving data ...