Hello from a newbie to the PIC and GCBASIC worlds! I've done a lot of computer work over the years, but my 18F4525 just sits there and doesn't seem to do anything. I loaded an extremely simple program and nothing seems to happen. Here is the code:
*******************************************************************************
'A program to flash two LEDs on PORTB, bits 0 and 1
'Chip model
#chip 18F4525, 20
'Set the pin directions
dir PORTD.6 out
dir PORTD.7 out
'Main routine
Start:
'Turn one LED on, the other off
SET PORTD.6 ON
SET PORTD.7 OFF
wait 1 sec
'Now toggle the LEDs
SET PORTD.6 OFF
SET PORTD.7 ON
wait 1 sec
I have programmed and verified the chip. I have power-cycled the chip and re-verified the program and it is there. Where do you find information on what values you should use on the "#chip" statement? What should I look at to get this program working? I would like to use the internal oscillator - how do you tell the chip to do this?
Thanks in advance for any tips you might be able to pass along!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Check out the Pic Crash Course, in the GCBasic.chm help file, located in the GCBasic dir.. That and other topics should answer your questions.
To find the configuration options available for a specific device, use the chipdata files in the GCBasic dir. To find the internal OSC options you would need to visit the data sheet, but they will be 8Mhz, 4Mhz, 2Mhz, 1Mhz .............. Say you wanted to use the 4 Mhz internal oscillator, you would write:
#chip 18f4525, 4
#config OSC=INTIO67
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello from a newbie to the PIC and GCBASIC worlds! I've done a lot of computer work over the years, but my 18F4525 just sits there and doesn't seem to do anything. I loaded an extremely simple program and nothing seems to happen. Here is the code:
*******************************************************************************
'A program to flash two LEDs on PORTB, bits 0 and 1
'Chip model
#chip 18F4525, 20
'Set the pin directions
dir PORTD.6 out
dir PORTD.7 out
'Main routine
Start:
'Turn one LED on, the other off
SET PORTD.6 ON
SET PORTD.7 OFF
wait 1 sec
'Now toggle the LEDs
SET PORTD.6 OFF
SET PORTD.7 ON
wait 1 sec
'Jump back to the start of the program
goto Start
*******************************************************************************
I have programmed and verified the chip. I have power-cycled the chip and re-verified the program and it is there. Where do you find information on what values you should use on the "#chip" statement? What should I look at to get this program working? I would like to use the internal oscillator - how do you tell the chip to do this?
Thanks in advance for any tips you might be able to pass along!!
It's probably your clock.
Check out the Pic Crash Course, in the GCBasic.chm help file, located in the GCBasic dir.. That and other topics should answer your questions.
To find the configuration options available for a specific device, use the chipdata files in the GCBasic dir. To find the internal OSC options you would need to visit the data sheet, but they will be 8Mhz, 4Mhz, 2Mhz, 1Mhz .............. Say you wanted to use the 4 Mhz internal oscillator, you would write:
#chip 18f4525, 4
#config OSC=INTIO67