View previous topic :: View next topic |
Author |
Message |
POPE19
Joined: 27 Jun 2017 Posts: 71
|
rs-232 simple HELLO print |
Posted: Fri Aug 04, 2017 12:01 pm |
|
|
Hello Guys,
I have got PIC16F887 prototype board from CCS. I am trying to print "hello" on my serial monitor of CCS compiler. I am using CCS PCWH 5.074. I am not getting output.
I have used TTL to USB cable to connect the DB9 connector of (serial PC to prototype board cable) that came with the kit . Here are my connections
TTL-usb adapter DB-9
RXD 1- RXD
TXD 3- TXD
GND 5 -GND
Here is my code.
Code: |
#include <16f877.h>
#fuses HS,NOLVP,NOWDT,PUT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#include <input.c>
void main()
{
while(TRUE)
{
printf("\n hello");
}
}
|
I am a beginner and really need to display PIC output on serial monitor. Please help. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Fri Aug 04, 2017 1:03 pm |
|
|
The prototype board using the DB9, contains a MAX232. So generates RS232, not TTL serial....
You need to disconnect the MAX232, and connect directly to the TTL level pins not the DB9. The schematic with the card shows how to do this.
The old board had jumpers for this. Not sure about the one you have. |
|
|
POPE19
Joined: 27 Jun 2017 Posts: 71
|
|
Posted: Sat Aug 05, 2017 5:13 pm |
|
|
It is working fine. Thanks Ttelmah !! |
|
|
|