16F886 & 18F2620

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
Ron
Posts: 225
Joined: Wed Apr 11, 2007 6:15 pm
Has thanked: 2 times

16F886 & 18F2620

Post by Ron »

Hi,

I want to compile my code for 8MHz and there is no selection for 8Mhz Internal OSC. How do I set it up in Flowcode?

Also, I know it is not your product but could you help me with the configuration bit settings to allow 8Mhz Internal using MPLAB.

I do not know which to select for Oscillator for INT 8Mhz,

Thanks

Ron

chevy6600
Flowcode V4 User
Posts: 115
Joined: Fri Feb 22, 2008 6:38 pm

Re: 16F886 & 18F2620

Post by chevy6600 »

Hi ron, i am no expert but i can direct you to a post that may help. I am also interested in using the 18F2620 and one of the things i wanted to do was set it up using the internal clock , so i asked the good chaps at matrix if they could help, which sean did, the link here is where to go, http://www.matrixmultimedia.com/mmforum ... t=25#p8164 the post includes a lot of other info which may or may not interest you, but the info you want is there some where.
hope this helps.

Ron
Posts: 225
Joined: Wed Apr 11, 2007 6:15 pm
Has thanked: 2 times

Re: 16F886 & 18F2620

Post by Ron »

Hi,

Thanks for the posting.... very long....

Sean, Steve, Ben....

I am in a tough spot.

Can you please tell me how/where I must put the "C" block in my code.

Can you please tell me what I need to put in this "C" block to get 8MHz internal OSC working. I want both pins available for I/O.

Is there anything else you need to know from me?

Thanks

Ron

chevy6600
Flowcode V4 User
Posts: 115
Joined: Fri Feb 22, 2008 6:38 pm

Re: 16F886 & 18F2620

Post by chevy6600 »

Hi ron, i think all you have to do to get your internal 8mhz is to just use the configuration data as is shown in the post. I cannot test how much data you need to copy from that post yet, as i have not got the chip myself yet. The reason for the PLL part is because i wanted 32mhz and sean added the extra PLL part as it is the multiplier which multiplies the 8mhz upto 32mhz .
best of luck.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: 16F886 & 18F2620

Post by Steve »

Set the config word appropriately (i.e. use the INTOSC clock) and then add the C code at the beginning of your main Flowcode program:

osccon = 0x70;

Ron
Posts: 225
Joined: Wed Apr 11, 2007 6:15 pm
Has thanked: 2 times

Re: 16F886 & 18F2620

Post by Ron »

Hi Sean,

here is part of a previous post that was referred to:

The oscillator mode you require for the PIC18F2620 is achieved in 3 steps.

1/ Select one of the INT oscillator modes in the chip configuration panel. The INT RC-CLKOUT option makes the internal clock available on pin RA6. The INT RC-port option makes the internal clock unavailable externally.

2/ Select the 8MHz clock option. The chip powers up with the internal clock set to 1MHz. The program must set this to the 8MHz option by writing the hexidecimal value 0x72 to the special function register OSSCON.

3/ Enable the PLL to produce the 32MHz clock signal. This should be achieved by writing the hexadecimal value 0x40 to the special function register OSCTUNE.

Steps 2 and 3 should be achieved from Flowcode with a C code block with the following contents:

osccon = 0x72;



You posted previously osccon = 0x70 for me, is 0x70 or 0x72 for 8Mhz?

Are the settings the same for the 16F886 and 18F2620?

When selecting Target speed in flowcode, do I simply type in 8000000 in drop down box?

Thanks

Ron

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: 16F886 & 18F2620

Post by Steve »

0x70 is fine (but 0x72 will work as well). This is the value for both chips.

And yes, select 8000000 in the clock speed drop-down.

Ron
Posts: 225
Joined: Wed Apr 11, 2007 6:15 pm
Has thanked: 2 times

Re: 16F886 & 18F2620

Post by Ron »

Hi Sean,

8MHz is not an option to select from the drop down list.

I have 5MHz and then 10MHz is the next option.

Is there a way to add 8,000,000 (8MHz) to the drop down list?

Thanks

Ron

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: 16F886 & 18F2620

Post by Steve »

Hi Ron,

Just type it in.

(by the way - I'm Steve, not Sean!)

Ron
Posts: 225
Joined: Wed Apr 11, 2007 6:15 pm
Has thanked: 2 times

Re: 16F886 & 18F2620

Post by Ron »

Hi,

Sorry about that, I think I read Sean,s name in the post that I cut & pasted the settings for.

Thanks

Ron

Post Reply