![]() | ![]() | ![]() |
| |||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
![]() |
| | Tools |
| | #1 |
|
Hi I've got my circuit wired up like this so far... The red wire acts as a loopback (for testing) so that anything i send out the serial port on my computer, i get straight back again. This is working perfectly. ![]() The plan is to remove the red link, and connect the TTL level signals to the USART of a PIC16F627 like this... ![]() The question is... How do I program the PIC to send and receive data?
__________________ Dave Pusey. PIC Programming Tutorials: http://www.mstracey.btinternet.co.uk...al/picmain.htm Brilliant PIC Simulator: http://www.oshonsoft.com/pic.html | |
| |
| | #2 |
|
Check my PIC RS232 tutorials, most use a software UART (so it can be used on any pin), but the last one shows how to use the hardware UART.
| |
| |
| | #3 |
|
Ok - a couple of questions... 1) What is the purpose of the test/loop in this code block? Code: XMIT_RS232 btfss PIR1, TXIF ;xmit buffer empty?
GOTO XMIT_RS232 ;no, wait
MOVWF TXREG ;now send
RETURN
I dont really want to keep polling the usart when it wont be used that often.
__________________ Dave Pusey. PIC Programming Tutorials: http://www.mstracey.btinternet.co.uk...al/picmain.htm Brilliant PIC Simulator: http://www.oshonsoft.com/pic.html | |
| |
| | #4 | ||
| Quote:
Quote:
| |||
| |
| | #5 |
| Do you have an example of this please?
__________________ Dave Pusey. PIC Programming Tutorials: http://www.mstracey.btinternet.co.uk...al/picmain.htm Brilliant PIC Simulator: http://www.oshonsoft.com/pic.html | |
| |
| | #6 |
| Fr. Tom McGahee Check out the PICUART.zip example. Enable the UART interrupt and configure the TRIS register correctly for the RX and TX pins, then when a byte is received the code will automatically jump to ORG h'0004'. | |
| |
|
| Tags |
| pic, programming, usart |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| usart with pic | neelam29 | Micro Controllers | 19 | 18th July 2009 09:39 AM |
| USART with PS/2 | andonur | Micro Controllers | 1 | 11th March 2009 12:40 AM |
| Usart + Adc | Overclocked | Micro Controllers | 5 | 28th January 2009 06:35 PM |
| PIC USART: Help Please | mortuzahasan | Micro Controllers | 2 | 11th February 2007 07:28 PM |
| HELP!!! nothing going through my USART!!! | Guyver | Micro Controllers | 8 | 6th May 2004 09:11 AM |