View previous topic :: View next topic |
Author |
Message |
sindyme
Joined: 05 Aug 2009 Posts: 37
|
help me about 18F63j11 |
Posted: Wed Aug 05, 2009 10:28 pm |
|
|
My PIC of 18F63J11 can't work !
I use external crystal at 8Mhz.
I look "CCS Project wizard" that it have
1. High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
2. High speed osc with SW enabled 4x PLL
3. External clock
4. External Clock with SW enabled 4x PLL
I select kind of 1 same 18F452 , but I use "HS" on PIC18F63J11 can't work.
Please help me Orz !!
My 18F63j11 .H file past it
Code: | #FUSES NOWDT
#FUSES WDT128
#FUSES HS
#FUSES NODEBUG
#FUSES NOXINST
#FUSES STVREN
#FUSES NOPROTECT
#FUSES FCMEN
#FUSES IESO
#FUSES PRIMARY
#FUSES RESERVED
|
and main
Code: |
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF|ADC_TAD_MUL_0);
setup_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
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);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
enable_interrupts(INT_RDA);
enable_interrupts(INT_RDA2);
enable_interrupts(GLOBAL);
|
|
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Wed Aug 05, 2009 11:27 pm |
|
|
Is your main really like that or more like:
Code: |
void main ( void ) {
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF|ADC_TAD_MUL_0);
setup_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
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);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
enable_interrupts(INT_RDA);
enable_interrupts(INT_RDA2);
enable_interrupts(GLOBAL);
while (1) {
}
}
|
please list more about compiler version, your FULL file... there's items missing from your post that need to be answered...
THanks,
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
sindyme
Joined: 05 Aug 2009 Posts: 37
|
|
Posted: Wed Aug 05, 2009 11:47 pm |
|
|
My CCS version is 4.084
and my main
Code: |
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF|ADC_TAD_MUL_0);
setup_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
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);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
enable_interrupts(INT_RDA);
enable_interrupts(INT_RDA2);
enable_interrupts(GLOBAL);
//delay_ms(500);
printf("Testing.....");
output_high(pin_B0); // Link a LED. if PIC work will ON
for(;;)
{
printf("Test Test");
}
} |
|
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Thu Aug 06, 2009 9:42 am |
|
|
unless you have service routines for your interrupts, I wouldn't enable them if I were you until you define something to handle them.
Ok, and now for the code prior to the main() ??
Do you have a #device <18F63j11.h>
You're using printf, so you'll need some #use rs232 statement.
Also, consider doing something that repeats..
like
Code: |
while (1) {
printf("Hello World\r\n");
output_high (LED);
delay_ms(500);
output_low(LED);
delay_ms(500);
}
|
_________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|