Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F877A RS232 running at 38400bps

Status
Not open for further replies.
I metered the voltage and it is 4,9 volt instead of 5 volt. Could this cause the strange numbers ???

Also I use capacitors of 65 Volt, 1 uF. Do I need to use less voltaged-capacitors??

Does anyone has a schematic of a MAX232 that works ???
 

MAX232 circuit is given in MAX232 datasheet. A table also gives Capacitor values to be used.
 
MAX232 circuit is given in MAX232 datasheet. A table also gives Capacitor values to be used.

I bought an RS232 to 0/5 Volt module in order to overcome the problem. I connected the Tx--->Rx in order to check if it sends the correct data.

It does not sends the correct data. I changed the baudrate to 9600 and then it sends the correct data.

As far as my major problem is concerned (that the my post belongs), could the 38400 bps be a problem for the strange numbers I get on the terminal PC, when I connect the PIC????
 

Zip and post your complete mikroC project files. I will test it using my EasyPICv7.
 
Here it is
 

Attachments

  • PIC16F877A_Zigbee_data.rar
    16.6 KB · Views: 66

Try this code. Don't test on breadboard. Test on a soldered board.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
void main()
{
    UART1_Init(38462);                 // Initialize UART module at 38400 bps
    Delay_ms(1000);                     // Wait for UART module to stabilize
 
    while(1)
    {
        UART1_Write_Text("DB7EHello World!");
        Delay_ms(1000);
    }
}



- - - Updated - - -

Try this code.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
void main() {
    
    TRISC = 0x80;
    PORTC = 0x00;
    
    UART1_Init(38462);                 // Initialize UART module at 38400 bps
    Delay_ms(200);                     // Wait for UART module to stabilize
 
    while(1) {
        UART1_Write_Text("Hello World!");
        Delay_ms(1000);
    }
}

 
hello

try with a CR LF at the end of string

Code:
...
while(1) {
        UART1_Write_Text("Hello World!\r\n");
        Delay_ms(1000);
    }
..

or simplest test

Code:
   .... 
   while(1)
   {
        UART1_Write('H');UART1_Write('e');UART1_Write('l');UART1_Write('l');UART1_Write('o');
        UART1_Write(13);UART1_Write(10);
        Delay_ms(1000);
    }
  ..
 
The 16F877A which I have is dead. I have ordered two new 16F877A's. I will get it in another 4 days. Wait till then. Once I get them I will test it on EasyPICv7 and report back. I also have to get 16 MHz crystal.
 
Hello! I changed the PIC with a new one and finally worked!!!! Thank you all for your help!!!!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top