internal osc question
Moderators: David Barker, Jerry Messina
internal osc question
Is there a specific way to setup the 8mhz internal osc on a pic18f1320?
i've used Config osc = INTIO2
then added
OSCCON = %01110110 as soon as i can in the program but it takes 30 seconds to start working .
any ideas?
PS
Would it be a good idea to add some more topics like a general PIC one.
i've used Config osc = INTIO2
then added
OSCCON = %01110110 as soon as i can in the program but it takes 30 seconds to start working .
any ideas?
PS
Would it be a good idea to add some more topics like a general PIC one.
Hmmm..
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
To ensure code gets executed first, just use a module. For example, create a module called 'io.bas' and place in your 'UserLibrary' folder...
Here is a sample program...
I programmed the above sample code onto a 18F1320 using a melabs USB programmer and it started to execute immediately on reset.
Code: Select all
// IO module
module IO
config osc = INTIO2
OSCCON = %01110110
Code: Select all
device = 18F1320
clock = 8
include "io.bas"
include "USART.bas"
include "EEPROM.bas"
include "Convert.bas"
SetBaudrate(br19200)
Write("Program starting...",13,10)
while true
Write("High",13,10)
delayms(500)
Write("Low",13,10)
delayms(500)
wend
internal osc with bootloader
Does anyone know if the tolerance on the internal oscillator on a pic is good enough to to use with a boot loader?
Hmmm..
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact: