Balachandar
- 28th August 2012, 09:31
Hi,
I am using PBP 2.60C with MicroCode Studio 4.0.0.0 for compiling a simple "Blink the LED" test program for 18F26K22. The short program is shown below. My problem is that no matter what I do, the compiling is not successful. MCS provides the option to select 18F26K22 device, but does not create the hex file and shows a series of error messages. Either I am making a mistake or there is an issue with PBP/MCS or some problem with the inc file.
DEFINE OSC 4 'Clock Speed: 4MHz
OSCCON = %11010010 'Internal oscillator is set to 4MHz
OSCTUNE = %10000000 'HFINTOSC selected; PLL disabled; Factory calibrated frequency
ADCON0.0 = 0 'Disable ADC
ANSELA = 0
ANSELB = 0
ANSELC = 0
ANSELE = 0
CM1CON0.7 = 0 'Disable comparator1
CM2CON0.7 = 0 'Disable comparator2
'Port direction
TRISA = 0 'All are Outputs
TRISB = 0 'All are Outputs
TRISC = 0 'All are Outputs
'An LED is connected to PORTC.3 through a 470 ohm resistor.
START:
PORTC.3= 1
PAUSE 500
PORTC.3 = 0
PAUSE 500
GOTO START
END
First I found that MPASM version 5.2 downloaded from MELabs site did not have the include file "P18F26K22.inc". I took the file from MPLAB version 8.87 and copied it to MPASM folder and tried to compile the code. The 23 error messages displayed by MC Studio are shown in the attached jpg file.
My idea is to use 18F26K22 in a complex project that currently uses 18F2620. I would highly appreciate help/suggestion from anyone that can lead to the resolution of my problem.
Regards,
Bala
I am using PBP 2.60C with MicroCode Studio 4.0.0.0 for compiling a simple "Blink the LED" test program for 18F26K22. The short program is shown below. My problem is that no matter what I do, the compiling is not successful. MCS provides the option to select 18F26K22 device, but does not create the hex file and shows a series of error messages. Either I am making a mistake or there is an issue with PBP/MCS or some problem with the inc file.
DEFINE OSC 4 'Clock Speed: 4MHz
OSCCON = %11010010 'Internal oscillator is set to 4MHz
OSCTUNE = %10000000 'HFINTOSC selected; PLL disabled; Factory calibrated frequency
ADCON0.0 = 0 'Disable ADC
ANSELA = 0
ANSELB = 0
ANSELC = 0
ANSELE = 0
CM1CON0.7 = 0 'Disable comparator1
CM2CON0.7 = 0 'Disable comparator2
'Port direction
TRISA = 0 'All are Outputs
TRISB = 0 'All are Outputs
TRISC = 0 'All are Outputs
'An LED is connected to PORTC.3 through a 470 ohm resistor.
START:
PORTC.3= 1
PAUSE 500
PORTC.3 = 0
PAUSE 500
GOTO START
END
First I found that MPASM version 5.2 downloaded from MELabs site did not have the include file "P18F26K22.inc". I took the file from MPLAB version 8.87 and copied it to MPASM folder and tried to compile the code. The 23 error messages displayed by MC Studio are shown in the attached jpg file.
My idea is to use 18F26K22 in a complex project that currently uses 18F2620. I would highly appreciate help/suggestion from anyone that can lead to the resolution of my problem.
Regards,
Bala