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

18F4550 doesn't work but 16F877 do WHY???

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



Joined: 08 Feb 2006
Posts: 1
Location: Gatineau

View user's profile Send private message

18F4550 doesn't work but 16F877 do WHY???
PostPosted: Wed Feb 08, 2006 3:16 pm     Reply with quote

I need to use a PIC18F4550 but I can just work with 16F877 WHY??? I use PIC WIZARD to do my program (and I reduce it do flashing A0). When I use the PIC18F4550 the delay_ms doesn't look to be working. I use a PIC 16F877 with the very same circuit and it works.

I think the option of 18F4550 is not working in the program...

Could anyone help me please ?!?!?

Maxime
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Thu Feb 09, 2006 7:36 am     Reply with quote

Post the relevant code, the compiler and the compiler version. It's hard to help without that info
_________________
The difference between genius and stupidity is that genius has its limits...
Guest








PostPosted: Thu Feb 09, 2006 2:50 pm     Reply with quote

PCW C Compiler IDE
version 3.224

and the code for the .c file:
#include "W:\projet\buz16f877.h"
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
while(TRUE)
{
output_high(PIN_A0);
delay_ms(1000);
output_low(PIN_A0);
delay_ms(1000);
}
}

and the code for the .h file :

#include <16F877.h>
#device ICD=TRUE
#device adc=8
#fuses NOWDT,HS, NOPUT, NOPROTECT, BROWNOUT, LVP, NOCPD, NOWRT, NODEBUG
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9)
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Thu Feb 09, 2006 3:07 pm     Reply with quote

Don't you need the PCWH compiler to compile for the PIC18? You have only listed the PCW compiler.
_________________
The difference between genius and stupidity is that genius has its limits...
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Thu Feb 09, 2006 3:12 pm     Reply with quote

Assuming you have the correct compiler, could it be something as simple as forgetting to change the header file to grab the new device?

I mention this because I did exactly that last night. I moved a working program from the 16F877 to the 16F452 and was beating my head against the wall for an hour trying to figure out why it was so dead, and realised I had forgotten to modify the header file to change the device type.
_________________
The difference between genius and stupidity is that genius has its limits...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 09, 2006 3:19 pm     Reply with quote

Quote:

#include <16F877.h>
#device ICD=TRUE
#device adc=8
#fuses NOWDT,HS, NOPUT, NOPROTECT, BROWNOUT, LVP, NOCPD, NOWRT, NODEBUG
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9)

1. Are you using a LVP programmer ? Most programmers, such as ICD,
ICD2, Warp-13a, PicStart-Plus, etc. are High Voltage programmers.
You use the NOLVP fuse with those programmers.

2. Your serial port is set for 9 bits. Most people use 8 bits.
Also, you should add the ERRORS directive.

3. You have NODEBUG in your #fuses statement, but then you have
#device ICD=TRUE which will override the NODEBUG statement.

Instead of posting the code for the 16F877, you should post the code
for the 18F4550 that fails. Fix any of the problems shown above
that are in that program before you post it.
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