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

What is happening with this code!!!

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



Joined: 30 Jan 2008
Posts: 197

View user's profile Send private message

What is happening with this code!!!
PostPosted: Thu Jul 08, 2010 8:06 pm     Reply with quote

Hi, I'm already going crazy with this short code!!! Evil or Very Mad , 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); 
   }
}
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Jul 08, 2010 10:02 pm     Reply with quote

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.
pilar



Joined: 30 Jan 2008
Posts: 197

View user's profile Send private message

PostPosted: Fri Jul 09, 2010 8:41 am     Reply with quote

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