View previous topic :: View next topic |
Author |
Message |
rajeshkhan808
Joined: 29 Aug 2012 Posts: 17
|
Rs232 Weird Loop Issue - Proteus Simulation (Solved) |
Posted: Mon Sep 03, 2012 1:01 am |
|
|
So I am using the following code and simulating in Proteus. I am using Pic16F877A
Code: |
#include <16F877A.h>
#fuses HS,WDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#FUSES NOBROWNOUT //No brownout reset
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
void main()
{ char answer;
Printf("Hello NY\r\n");
while(true)
{
output_high(PIN_B1);
delay_ms(2000);
output_low(PIN_B1);
delay_ms(2000);
}
} |
Now the funny thing is I keep on getting
Code: |
Hello NY
Hello NY
Hello NY
Hello NY
Hello NY
... |
as if its in a loop although its not ? Why is that. Why does the virtual terminal keep printing Hello NY continuously ? Any suggestion and remedies ?
Last edited by rajeshkhan808 on Mon Sep 03, 2012 8:03 am; edited 1 time in total |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Mon Sep 03, 2012 1:24 am |
|
|
Watchdog....
It is triggering, and restarting the code.
Best Wishes |
|
|
rajeshkhan808
Joined: 29 Aug 2012 Posts: 17
|
|
Posted: Mon Sep 03, 2012 1:41 am |
|
|
Thanks that solved it |
|
|
|