Serial comm using pic16f877a....

Thread Starter

RRITESH KAKKAR

Joined Jun 29, 2010
2,829
Should we send data from PC then if A is pressed led will glow something like that??

someone suggest me this:
This is described as a Virtual Serial port, suggesting that the output is RS232 levels , not TTL... If this is the case it will damage your pic.
 

tshuck

Joined Oct 18, 2012
3,534
Should we send data from PC then if A is pressed led will glow something like that??

someone suggest me this:
I doubt that. Since, provided you listened, you got a USB to TTL converter, the output should be TTL... The only application I could think to use full RS-232, would be a USB to serial port (DB9)), which this is not.

Sure, you can do that. In fact, a good idea might be to illuminate the LED on the UART receive interrupt, that way you can know the PIC had received something...
 

tshuck

Joined Oct 18, 2012
3,534

Thread Starter

RRITESH KAKKAR

Joined Jun 29, 2010
2,829
I have the same circuit working well with other codes..
as i said the tx is connected to rx vice versa and power is taken from that module only no external power taken from battery.
 

tshuck

Joined Oct 18, 2012
3,534
I have the same circuit working well with other codes..
as i said the tx is connected to rx vice versa and power is taken from that module only no external power taken from battery.
A picture would help us verify, but you don't want us to, that's fine...:rolleyes:

To be entirely clear and not leave room for implications that may be wrong, you have the RX of the USB to TTL module connected to the TX pin of the PIC? Likewise, the TX of the USB to TTL module connected to the RX pin of the PIC. The grounds are connected together, meaning the PIC is sharing the same ground as the USB to TTL module, and power (+5V) is also derived from the USB to TTL module. You have a 20MHz crystal attached to the PIC, with the proper capacitors on it. Both power and ground pins on the PIC are connected together.


Is this how you have it hooked up?
 

tshuck

Joined Oct 18, 2012
3,534
YES.....exactly same
and don't worry of crystal it is also working fine because ledbling and other code are working fine in board.
That does not mean it is working to the standard of the timing required in UART communication. What are your capacitor values on the crystal?


Have you tried powering the PIC from an external power supply? If not, try that, hut remember to connect grounds together, do not connect power...
 
Top