CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Rs232 Weird Loop Issue - Proteus Simulation (Solved)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rajeshkhan808



Joined: 29 Aug 2012
Posts: 17

View user's profile Send private message

Rs232 Weird Loop Issue - Proteus Simulation (Solved)
PostPosted: Mon Sep 03, 2012 1:01 am     Reply with quote

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: 19513

View user's profile Send private message

PostPosted: Mon Sep 03, 2012 1:24 am     Reply with quote

Watchdog....

It is triggering, and restarting the code.

Best Wishes
rajeshkhan808



Joined: 29 Aug 2012
Posts: 17

View user's profile Send private message

PostPosted: Mon Sep 03, 2012 1:41 am     Reply with quote

Thanks that solved it
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group