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.
downloaded code running at 500Khz
Moderator: Benj
-
- Posts: 28
- Joined: Wed Sep 26, 2018 2:15 pm
- Has thanked: 3 times
- Been thanked: 3 times
- Contact:
downloaded code running at 500Khz
- 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
-
- 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
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.
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
-
- 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
Ok I have worked out your issue.
You have placedwithin commented out section.
So you need to use
instead of
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.
You have placed
Code: Select all
OSCCON=0x78;
So you need to use
Code: Select all
/*
Enter C code below this comment
*/
OSCCON = 0x78;
Code: Select all
/*
Enter C code below this comment
OSCCON = 0x78;
*/
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
-
- Posts: 28
- Joined: Wed Sep 26, 2018 2:15 pm
- Has thanked: 3 times
- Been thanked: 3 times
- Contact:
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact: