Hi
I'm trying to program a PIC18F14K22 and I'm having trouble, I think, with getting the internal oscillator to start. I'm just trying to turn an LED on and off but with no success. I'm using Hi_Tech C complier and a PicKit3. I can compile the code and program the pic fine but cannot get the LED to turn on.
Any help would be great.
Thanks
Amy
Starting internal oscillator on 18F14K22
Moderator: Benj
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Starting internal oscillator on 18F14K22
Hi Amy,
Have you used a C block at the beginning of your with an osccon command (e.g osccon = 0x70;) set at a value suitable for your application?
Take a look at http://www.matrixmultimedia.com/mmforum ... 368#p16368
There is a bit of information on osccon.
Or you can search for that keyword on this forum.
The datasheet for 18F14K22 will have the correct values for osccon.
If your still stuck ,then post a flowchart and state the osc speed you require.
We can then take a look at it for you.
Martin
Have you used a C block at the beginning of your with an osccon command (e.g osccon = 0x70;) set at a value suitable for your application?
Take a look at http://www.matrixmultimedia.com/mmforum ... 368#p16368
There is a bit of information on osccon.
Or you can search for that keyword on this forum.
The datasheet for 18F14K22 will have the correct values for osccon.
If your still stuck ,then post a flowchart and state the osc speed you require.
We can then take a look at it for you.
Martin
Martin
Re: Starting internal oscillator on 18F14K22
Thanks Martin
I do have the C block at the beginning with an osccon command. I think the problem is related to the 18F14K22 definition file I have as I can not configure the chip in the configure chip settings as it is not listed in the drop down box.
I did manage to get it working by using MPLAB to configure and program the chip by importing the hex file I created in Flowcode. I would prefer to do the whole lot with Flowcode by this may not be possible.
Amy
I do have the C block at the beginning with an osccon command. I think the problem is related to the 18F14K22 definition file I have as I can not configure the chip in the configure chip settings as it is not listed in the drop down box.
I did manage to get it working by using MPLAB to configure and program the chip by importing the hex file I created in Flowcode. I would prefer to do the whole lot with Flowcode by this may not be possible.
Amy