![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
pilar
Joined: 30 Jan 2008 Posts: 197
|
What is happening with this code!!! |
Posted: Thu Jul 08, 2010 8:06 pm |
|
|
Hi, I'm already going crazy with this short code!!! , this code works perfectly in a Pic16F877 at 20MHz, including the simulation with Proteus also works, but I can not do work in a PIC18F452. I already tried with three PIC18F452 !!! and none works, someone could say This is my mistake?
Here is my code:
Code: | #include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP,NOBROWNOUT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)// RS232 Estándar
void main(){
while(TRUE){
printf("Hello Word!!!\r\n");
delay_ms(200);
}
} |
|
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Thu Jul 08, 2010 10:02 pm |
|
|
The code is oké, your problem is somewhere different.
Try the next test program. Connect a LED or scope to the output pin.
This program is simpler to avoid RS232 (hardware) problems and it can be used to test the program is running at the correct frequency.
Code: | #include <18F452.h>
#fuses HS,NOWDT,PUT,NOLVP,NOBROWNOUT
#use delay(clock=20000000)
void main()
{
while(TRUE)
{
output_toggle(PIN_C1);
delay_ms(1000);
}
} |
Post your compiler version number. |
|
![](templates/subSilver/images/spacer.gif) |
pilar
Joined: 30 Jan 2008 Posts: 197
|
|
Posted: Fri Jul 09, 2010 8:41 am |
|
|
Thank... |
|
![](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
|