PIC16F877A interface with computer

Thread Starter

ericyeoh

Joined Aug 2, 2009
58
i;m hv done using PIC 16F877A to interface with computer.
result is successfully tested by using a hyperterminal
But a question marks comes up in the transmission part.
Any professional can tell me whats going on between this transmission section?
What actually data presend in before send and after? Hex data? ASCII data?
if ucontroller send a data "Ci", how the computer knows is "Ci"
Signal analysis
1. how do computer knows when the data is come and finish?
2. How the uController knows the data has send finished and whats is the maximum data can be send?
The maxim232 is used for voltage converter in order to let the computer or uController to know when the data has to be "1" or "0".
 

BMorse

Joined Sep 26, 2009
2,675
Question mark, and other weird chracters that are coming through the hyperterminal means you have the BAUD Rate set wrong.... if you sent hexadecimal numbers that represent ascii characters you should see the same thing in the hyperterminal window...
 

chat_eur

Joined Dec 30, 2009
7
1. how do computer knows when the data is come and finish?

Data is sent as frames which are related to the protocol you use. Lets say you have 8bit data, 1bit stop and no parity configuration, your data will be sent as

start-dddddddd-stop.

Computer or micro device will understand that communication has been started with start bit then it will wait for 8bit data bits and then stop bit. If you choose your configuration wrongly (baudrate, databits, etc.), you will see unmeaningful characters.

2.whats is the maximum data can be send?

In one frame you can send 1byte. Data is sent byte by byte. In total, there is no limit except buffers. There are usually buffers to catch data to prevent data lost in case of computer or controller is busy. In high level programming languages, you can set the buffer limit and if you don't read incomming packets, in case of buffer overflow, new packets will be lost.
 

t06afre

Joined May 11, 2009
5,934
Perhaps you should read more about RS232 and UARTS. This will give you some answers. Just Google this two terms. I am sure wiki has some information on this topic.
It is very hard to say something about how much data that can be sent. As it depends on many factors. Could you tell us more about how you plan to set up your communication. Also include information about your uC clock speed.
 

BMorse

Joined Sep 26, 2009
2,675
The pic16F877A has a 2 byte buffer.......

to figure out if uc is done sending data the op can check the TRMT bit to see if it is clear, No interrupt logic is tied to this bit so the user has to poll this bit in order to determine if the TSR register is empty.
 
Top