View previous topic :: View next topic |
Author |
Message |
mizi_suichiro
Joined: 23 Mar 2004 Posts: 7
|
HELP ON RS232 AND PIC16F877 |
Posted: Tue Mar 23, 2004 6:11 am |
|
|
hi, i'm blur with this microcontroller. i need to read an 8-bit data from memory buffer (external hardware) and send it through serial port into a PC. i don't know how to setup the PIC16F877 so i can transmit 8 bit data serially to the PC using Tx and Rx pin. i'm using C++ programming, but i stuck about how to send the reading 8 bit data to the PC and i can read data. (the memory buffer contains the information from the CMOS camera).
hope anyone can help me with this thing. thanks. |
|
![](templates/subSilver/images/spacer.gif) |
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue Mar 23, 2004 7:00 am |
|
|
You are using C++? So you are not using CCS?
If you are using CCS, you can use the #use RS232 statement to define a serial port and then communicate using the built-in functions (such as printf(), getc() and putc()). PIC16F877 has a hardware serial port on pins C6 and C7 so you can use this:
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
Refer to compiler manual for more information. |
|
![](templates/subSilver/images/spacer.gif) |
mizi_suichiro
Joined: 23 Mar 2004 Posts: 7
|
|
Posted: Tue Mar 23, 2004 7:08 am |
|
|
i'm using CCS, and using C languange to make the microcontroller work. if i set the RS232 function like you says, so i just using function printf() to send the data to PC? is it right? can you give me a little bit example of the programming. thanks. |
|
![](templates/subSilver/images/spacer.gif) |
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue Mar 23, 2004 4:30 pm |
|
|
That is right. Look at the EX_SQW.C file in your \Examples directory. It explaines things pretty well. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Wed Mar 24, 2004 4:07 am |
|
|
thanks!! |
|
![](templates/subSilver/images/spacer.gif) |
|