I have problems on having formed internal oscillator

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

Moderator: Benj

Post Reply
User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

I have problems on having formed internal oscillator

Post by Francisco Cabrera »

Hello friends, I have a program that does not work, I think that it is a failure of configuration Of the project, I formed internal oscillator to 4mhz for the pic 16f88,I think that I have formed something badly, I need help to solve the problem .......Someone can help me checking the project please? .... regards.
Attachments
INSOLADORA.fcfx
(11.85 KiB) Downloaded 263 times
Last edited by Francisco Cabrera on Tue Jul 12, 2016 3:09 pm, edited 1 time in total.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Because the program does not work?

Post by jgu1 »

Hi Francisco!

In your config setting, and oscillolator selection, try to set it on XT.

Best regard


Jorgen.. :D

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: Because the program does not work?

Post by Francisco Cabrera »

The PCB this perfect, he working well, with the same program that I have put, but designed with another software, but with flowcode is impossible, does not work, I need, to stop designing with another program and designing my projects with flowcode ..... because of it I want to do that it works ...

PD: :D A lot of thank you for your answer,but my problem is that I have to put internal oscillator because already I have the made PCB .... regards .

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: I have problems on having formed internal oscillator

Post by kersing »

You need to add a C code block with

Code: Select all

osccon = 0b01100010;
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: I have problems on having formed internal oscillator

Post by Francisco Cabrera »

I am new in flowcode, he forgives my ignorance, This well put the code ? Regards..... :oops:
Attachments
INSOLADORA.fcfx
(12 KiB) Downloaded 273 times

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: I have problems on having formed internal oscillator

Post by Francisco Cabrera »

For my, it is impossible to make work project with flowcode, I do not understand because it is necessary to put a code of programming in c if already I have selected internal oscillator.... :?:

I think that if I choose internal oscillator flowcode already has to work,The opposite serious a bug of the program :?: ?
I to put the code c and does not work ...... but in the simulation if it works ok....Because of it I do not understand it...

PD:Someone is experienced at selection of internal oscillator and can say to me that I am doing badly? Regards

medelec35
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: I have problems on having formed internal oscillator

Post by medelec35 »

Hi
The clock speed within Flowcode is used for any components that require delays and other time settings that are dependent on the oscillator speed of hardware
It does not set the speed of hardware itself
For example if the clock speed is set at 8000000 (8MHz) but you have a 4MHz crystal connected, then hardware will be running at 4MHz and not 8MHz

However all the timings will be out since clock is set to 8MHz and does not match the hardware.
So if you have a 1 second delay, it will actually be 2 seconds on hardware.

Same with internal osc.
The Clock speed does not set the actual hardware speed, again its for delays and critical timed components.
Hardware speed is set by the osccon command placed at the very start of main.
to determine correct value for FC6 you will need to look at the datasheet.
from that you can determine correct osccon value to set hardware at 4HMz.
This post uses a different target device and different osc speed but principle is the same for all speeds.
So check the datasheet for your specific target device.

Maritn
Martin

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: I have problems on having formed internal oscillator

Post by Francisco Cabrera »

Thank you very much for your magnificent help, regards.

medelec35
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: I have problems on having formed internal oscillator

Post by medelec35 »

Hi Francisco Cabrera,
Your welcome if that included my post.
Are you all up and running as expected now?
Martin

Post Reply