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

problem with pic18f2550 code ... might be my configuration

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







problem with pic18f2550 code ... might be my configuration
PostPosted: Sun Apr 23, 2006 9:20 pm     Reply with quote

I'm having problems with my pic18f2550 code or configuration.

I have a test board setup that I know works for a pic16f876a (I set it up for the pic18f2550 but tried a pic16f876a after found out that they have a similary pin-out). So i'm pretty sure that the board is not the problem. So next i tried making the simplest code possible to blink an led.. I dont get anything. I donno what the problem is

The board has a 20mhz CR, the problem could be in the configuration. I read the oscillator configuration from the datasheet and it seems that the below fuses should work fine.

If anyone sees a problem please let me know because i'm stumped

Thanks
Nick



Code:
//test pic18f2550
#include <18F2550.h>

#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN

#use delay(clock=48000000)


void main()
{
output_high(pin_b7);
output_high(pin_a1);
delay_ms(1000);
output_low(pin_b7);
output_low(pin_a1);
delay_ms(1000);
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 24, 2006 11:47 am     Reply with quote

Try a more simple program. This program assumes you have a
20 MHz crystal. If not, change the clock value to the appropriate
frequency. If your crystal is 4 MHz or below, change the HS fuse to XT.

Code:
#include <18F2550.h>
#fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP, NOPBADEN
#use delay(clock=20000000)

void main()
{

while(1)             
  {
   delay_ms(500);
   output_high(PIN_A1);
   delay_ms(500);
   output_low(PIN_A1);
  }

}
NickLatech
Guest







PostPosted: Mon Apr 24, 2006 4:27 pm     Reply with quote

looking at your code I found out what my problem was.. i forgot the infinite loop. working at night sometimes is just a waste of time..

thanks a million for the help!

Nick
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