[PIC] Serial send a string from pic with proteus

Status
Not open for further replies.

ankiterect

Newbie level 4
Joined
Nov 16, 2013
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
41
can anyone tell me that why my circuit not giving correct output.

my proteus circuit

my virtual terminal output

my mikro c code


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void newline()
{
UART1_Write(13); // Carriage Return
UART1_Write(10); // Line Feed
}
void main()
{
  do
 {
      UART1_Init(9600);              // Initialize UART module at 9600 bps
      Delay_ms(100);                  // Wait for UART module to stabiliz
      UART1_Write_Text("hello");
     newline();
     Delay_ms(100);
 }  while(1);
}

 
Last edited by a moderator:

The below lines are for UART initialization and should be placed before do{}while loop in the main() function.

Code C - [expand]
1
2
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabiliz

 

jayanth now same problem is coming i have intialize my uart before the do while loop

- - - Updated - - -

i am thinking there are some clock frequency problem but i am not recorgnise completely please anyone help me
 

Maybe Compiler is generating wrong baudrate. Change baudrate settings in Proteus and see if you get right output for any other baudrate. Before UART initialization code add

Code C - [expand]
1
TRISC = 0x80;

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…