downloaded code running at 500Khz

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

Moderator: Benj

Post Reply
gavin mack
Posts: 28
Joined: Wed Sep 26, 2018 2:15 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

downloaded code running at 500Khz

Post by gavin mack »

Flowcode program runs fine on simulator, and when code is downloaded to 16f1937 using the 19Mhz external oscillator on eb-006.
modified the code to include the osccon code of 0x78 using intosc helper tool for 16Mhz, changed oscillator to internal in configuration and typed 16Mhz frequency in general options. moved clock jumper on eb-006 to ra6and7. see attached images for screen shots of settings. When revised code is downloaded to 16f1937 it runs as if the clock is set to 500Khz. flowcode program also attached.
Attachments
Project_options_configure.PNG
(21.81 KiB) Downloaded 2028 times
osccon_1.PNG
(4.21 KiB) Downloaded 2028 times
TEST_10_INT_OSC.fcfx
(26.05 KiB) Downloaded 306 times

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: downloaded code running at 500Khz

Post by medelec35 »

Hi Gavin,
Have you tried the one second flash test to determine actual speed as there could be an issue affecting your results?
E.g issue with inputs as that is setting the delay time.
Martin

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: downloaded code running at 500Khz

Post by medelec35 »

Ok I have worked out your issue.
You have placed

Code: Select all

OSCCON=0x78;
within commented out section.
So you need to use

Code: Select all

/*
  Enter C code below this comment
*/
 OSCCON = 0x78;
instead of

Code: Select all

/*
  Enter C code below this comment
 OSCCON = 0x78;
*/
As you are correct.
Since OSCCON=0x78; is within commented out section, Hardware is running at the default 500KHz internal osc speed, since OSCCON code is being ignored.
Move it out and you should be ok.
Martin

gavin mack
Posts: 28
Joined: Wed Sep 26, 2018 2:15 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: downloaded code running at 500Khz

Post by gavin mack »

Thanks for that Martin, it works fine

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: downloaded code running at 500Khz

Post by medelec35 »

That's great,
Thanks for letting me know.
Martin

Post Reply