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 CCS Technical Support

newbie question

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








newbie question
PostPosted: Wed Dec 22, 2004 10:26 am     Reply with quote

i am trying to flash an LED. using a PIC16f84a, the code works fine. but same code doesnt work for a PIC18f452???

Code:
#include <18F452.h>
#device adc=8
#use delay(clock=4000000)
#fuses NOWDT,WDT128,XT, NOPROTECT, NOOSCSEN, BROWNOUT, BORV20, NOPUT, STVREN, NODEBUG, LVP, NOWRT, NOWRTD, NOWRTB, NOWRTC, NOCPD, NOCPB, NOEBTR, NOEBTRB
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9)


Code:
void main()
{

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
   
   while (1) {
     
      output_high(PIN_B4);
      delay_ms(500);
     
      output_low(PIN_B4);
      delay_ms(500);
     
   }

}


what am I missing here?
Guest








PostPosted: Wed Dec 22, 2004 10:53 am     Reply with quote

I forgot to tell you what is exactly the problem. the problem is that all the LED is not flashing, and is lit.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 22, 2004 1:37 pm     Reply with quote

1. Change the "LVP" fuse to "NOLVP", unless you know for sure
that you're using a Low Voltage Programmer. 99% of users
do not use a LVP programmer, and so should set it to NOLVP.

2. Normally the RS232 is 8 bits. Is there a reason why you
have it set to 9 bits ?
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