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

8720, programming but not running

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








8720, programming but not running
PostPosted: Thu Dec 02, 2004 12:25 pm     Reply with quote

Hello everyone,

I bought recently the Microchip development board with pic8720 on it.

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010058&part=DM183020

I connected it with ICD2 and MPLAMB and wrote a simple code with ccs pic_c compiler PCH v3.082

#include <18F8720.h>

#use delay(clock=20000000)

#use fast_io(B)
#use fast_io(D)

#byte port_b=0x0f81
#byte port_d=0x0f83

/********* INIT PIC ***************/
void initpic(void)
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256|RTCC_8_BIT);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DIV_BY_16,255,16);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
}

void main()
{
initpic();
set_tris_d(0x00);
set_tris_b(0x00);

while(1)
{
output_high(PIN_B3);
output_d(0xff);
delay_ms(1000);
output_low(PIN_B3);
output_d(0x00);
delay_ms(1000);
}
}

the fuses are HS and power on reset all the others disabled.
i connect leds to pin_b3 and to port d.
i programm succesfull, but it doesnt run.
i mean havent checked it with debuger, but no led is going on anyway.

I would like to ask if i am doing something wrong, or is something that i missed, because is the first time that i use pic18f8720.

thank you in advance
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Dec 02, 2004 12:50 pm     Reply with quote

Add this line near the top

#fuses HS, PUT, NOLVP, NOWDT
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Dec 02, 2004 12:52 pm     Reply with quote

Did you also unplug the ICD2? It will hold the device in reset unless you click the release from reset on the tool bar. Also, do you have the jumper correct for the LEDs.
Kostas K
Guest







8720, programming but not running continuing
PostPosted: Sun Dec 05, 2004 12:03 pm     Reply with quote

Thanks Mark,

I have done what you have suggested.

No luck.

I tried it in debbuger mode, and i found out that no code was written in program memmory, just a few RRRR

i also realized that after compilation i got an error about xxx.cod file
i choose in built options none or extended cod or coff, in the frist two choises i get the error that xxxx.cod couldnt found and in the third that xxx.cof couldnt found.

finally i loaded the demo source code from microchip which is in asm, and it worked fine.

any idea anyone?

thanks anyway
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