PDA

View Full Version : 7 bit ASCII to 16F877



Ddewit
- 18th November 2008, 14:46
Hi

I wrote a program to transmit & receive data from & to a PC and its working fine. It even displays the character I type on my keyboard on my LCD. Now I need to change the program to receive data from a serial instrument & display it on the LCD. Most of the data are displaying correctly but some show up as garbage. Can it be because the instrument uses a 7 bit ASCII protocol & how can I change my program to work with 7 bit data?

mackrackit
- 18th November 2008, 15:12
Hardware or software?

From the manual under SERIN2
[quote]
A DEFINE allows the use of data bits other than 8 (or 7 with parity).
SER2_BITS data bits may range from 4 bits to 8 (the default if no
DEFINE is specified). Enabling parity uses one of the number of bits...
[quote]

Ddewit
- 19th November 2008, 05:45
To mackrackit

To what manual are you refering?
The only manual I'm using are the PICmicro Mid-Range MCU Family Reference Manual & the PIC16F877 Data Sheet.

I'm using USART on port RC6 & RC7 to transmit & Recieve.

mackrackit
- 19th November 2008, 05:54
The Pic Basic Pro or Pic Basic manual.

You are not using either one are you? Well that is the language we use here. What language are you using? Might be able to point you in the right direction.

Ddewit
- 19th November 2008, 08:01
To mackrackit

I'm Using ASM

mackrackit
- 19th November 2008, 08:09
Using ASM, this is the place for you
http://www.piclist.com/techref/piclist/index.htm

But I have to give a plug for basic :)
http://www.melabs.com/
They have a demo
http://www.melabs.com/pbpdemo.htm
Yes it cost some, but soooo much easier. At least we think so here.

Have a good one!