![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
shashank27187
Joined: 28 Jul 2009 Posts: 13
|
Help.. serial monitor problem in CCS C window |
Posted: Mon Aug 03, 2009 1:09 am |
|
|
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.
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. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Aug 03, 2009 1:29 am |
|
|
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 ? |
|
![](templates/subSilver/images/spacer.gif) |
shashank27187
Joined: 28 Jul 2009 Posts: 13
|
|
Posted: Mon Aug 03, 2009 3:19 am |
|
|
Thank You.. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|