Pic16f690 Serial Communication C Code Formatter
Pic16f690 Serial Communication C Code Formatter Rating: 3,2/5 5994votes
Sorry guys, I use assembly codes rather than c. Please tell me where I went wring with the codes.
Variables including structures may be directly mapped to memory such as I/O ports to best represent the hardware structure in C. Knoppix Boot Only Isoniazid on this page. The microcontroller clock speed may be specified in a PRAGMA to permit built-in functions to delay for a given number of microseconds or milliseconds. Serial I/O functions allow.

Geometrix Do I need an interrupt to recieve data??? Or can I just test from framing error, overrun error, and then load RCREG? I haven't read through your code, but these are NOT the flags to check to see if a character has arrived.
If any of these flags get set then you have an error and you will not receive any more characters until you reset the UART. You don't need to use an interrupt, providing you think about how you are doing things in your code, but using an interrupt, t put the incoming characters into a FIFO from where your application program can get them makes life a lot easier.
You also do not load RCREG with anything, you read it to get a character. You may load TXREG to send a character, when necessary. Neal, I have a similar project that I am off and on with. My particular version started with a PIC18F252 and 20x4 LCD.
I was also feeding the GPS data from a Garmin GPS III. This leads me to my first question: What kind of GPS are you using? A module or some kind of hand held/mobile unit? The reason I ask this is that no one has brought up the interfacing aspect. If you are using a module, does it have some kind of TTL output? If not, are you trying to feed RS232 levels directly into the PIC? If so, you will need some kind of level converter like an ST202 between the GPS and the PIC.
We make a simple breadboard pluggable version: If it's a module, what TTL voltage? Since starting this project, I moved from a hand held to a Micro Modular MN5010HS module. This module has a 3.3V TTL interface and the PIC is a 5V TTL interface, so I still had to use an ST202 to interface it, but in a roundabout way. I feed the 3.3V TTL into the ST202's channel 1, I then jump that channel's RS232 out to the RS232 in on channel 2. The TTL output of channel 2 is now at 5V TTL levels and I feed that into the PIC's USART. This is working very well for me, but I need to find a more discreet way to do this level conversion.
Download Vbag Tanpa Key. I know that it can be done with a couple MOSFETs. Once you have the interface right, you can start looking for anything to get captured in the buffer, but you also have to check for overruns.
This is what kept getting me early on. I was getting lots of unexpected resets caused by overrun errors. If you search this forum, you should find the old thread that I started.
I posted almost all of my working code at the time and it might be a good starting point. Dear Jason, I am using a Polstar PMB-648.
I purchased this on Parallax's website (). It came with a driver board and its own firmware. The PMB-648 was connected to the driver board with a short wire harness. The driver board was set up to Tx an Rx over a single wire. By disconnecting the GPS receiver (PMB-648) from the driver board and looking at the datasheet for the pinouts, I was able to connect 5V, GND, Tx, and Rx pins to the proper pins on my breadboard. I just cannot seem to figure out how to receive data. I thought that I had the code written properly.and then somebody suggested using an interrupt.
I think that this might be a good idea based upon,my limited understanding of a serial port receive interrupt, but I am not quite sure how to implement this either.
