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 support@ccsinfo.com

Help.. serial monitor problem in CCS C window

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



Joined: 28 Jul 2009
Posts: 13

View user's profile Send private message

Help.. serial monitor problem in CCS C window
PostPosted: Mon Aug 03, 2009 1:09 am     Reply with quote

Hey...

I'm using 18f2585.
After programming the micro controller I've put it in the circuit as per the design to read it.

The code used is:
Code:

#include <18f2585.h>
#fuses HS,NOPROTECT,NOLVP,NOWDT
#use delay(clock=2000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

//====================================
int i;
void main()
{

for (i=1;i<1000;i++)
  {
 
   printf("%d",i);
   delay_ms(1000);
   output_low(PIN_B0);
   delay_ms(2000);
   output_high(PIN_B0);
   delay_ms(1000);
  }

}

Here, while reading the values, the LED toggles correctly in the board, but the serial monitor window displays something different than what it should actually display.

Here is what is being shown:
(top of the window)
Code:
ÿÿÿÿþþþþÿÿÿþþþþþÿÿþÿþþþþþþþþÿþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüüüüþüüüþþü

and
(bottom of the window)
Code:

FE FE FF FF FF FE FE FE FE FE FF FF FE FF FE FE FE FE FE FE FE FE FF FE FE FC FC FC FE FC FC FC FE FE FC FC FC FC FF FC FC FE FE FE FC FC FC FC FC FE

Do you guys have any idea whts wrong with it ?

The output's hex value should lie in range of 00-7F,
but the values are printed with hex value more than 7F, even when it is not asked to do so. Shocked

The above code works well with 16f877a and also the LED toggles.

Moreover the compiler and the board I have used to program and read is also the same.

HELP ME.

Thanks in advance.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Aug 03, 2009 1:29 am     Reply with quote

Quote:
#include <18f2585.h>
#fuses HS,NOPROTECT,NOLVP,NOWDT
#use delay(clock=2000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

Look closely at the line in bold. Is that what you intend ?
shashank27187



Joined: 28 Jul 2009
Posts: 13

View user's profile Send private message

PostPosted: Mon Aug 03, 2009 3:19 am     Reply with quote

Thank You..
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