Hi Brian,
I would guess it's something in the default configs that is/are? at odds with your code, better to hand code the configs so you know what you have.
DEFINE OSC ??
Hi Brian,
I would guess it's something in the default configs that is/are? at odds with your code, better to hand code the configs so you know what you have.
DEFINE OSC ??
Last edited by Archangel; - 30th October 2013 at 02:02.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bit 7 of OSCCON, should not be a zero?
Ioannis
bit 7 only matters if using sleep
add led1=0 near the beginning of your code
You should also define the osc to 08
Shawn
Try
OSCCON = %01111000
OSCTUNE = %01000000
DEFINE OSC 32
I use "INTIO2" but your setting should make no difference if you don't use osc pins as digital in/out.
Cheers
Al.
All progress began with an idea
I'm not the best at reading the manual for this chip but from what I read on the data sheet OSCTUNE = %01000000 bit 6(PLLEN) can only be used with a 4 or 8 MHz oscillator.
OSCCON = %01111000 defines a 8 MHz internal oscillator. I think the first part should be of OSCCON should be OSCCON = %011111xx that defines an internal stable oscillator. I don't understand what the last two bits do so that would take some more exploration. It looks like you've got a plethora of options that depend on your specific situation.
In smaller chips the port usually needs to be set to digital for LEDs to light. I couldn't figure out how to do that for this chip.
Also, if the LED takes 2.2 volts of the 5 volts applied that leaves 2.8 volts for the 1k resistor. That's only 2.8 milliamps if the chip doesn't drop any voltage. I think that's low and am surprised it will light with 5 volts applied.
I hope it helps.
He is using high brightness LEDs. They might consume less than the average 20mA used by common LEDs (might be very high efficiency LEDs).
Robert
Bookmarks