Page 1 of 1

Missing prescaler setting Timer 2 [Solved]

Posted: Wed Jan 03, 2018 2:08 pm
by QMESAR
Hi Ben,
Sorry about this :oops:
I have the same issue with a PIC16F1786 device where the Timer 2 prescaler can only set up to 16 and not 64,in the PWM component
Please can you organize me a fix :D

Re: Missing prescaler setting Timer 2

Posted: Wed Jan 03, 2018 2:16 pm
by Benj
Hi Peter,

Good spot, these have now been added for you.
PIC.zip
(36.71 KiB) Downloaded 236 times

Re: Missing prescaler setting Timer 2

Posted: Wed Jan 03, 2018 2:26 pm
by QMESAR
Thanks a million Ben :D

Re: Missing prescaler setting Timer 2

Posted: Wed Jan 03, 2018 2:57 pm
by QMESAR
Hi Ben.
Thank you for the PWM fix it is working Fine :D
Can you please help me understand (attached is the Flowchart) before adding the pwm component the Flowchart used 3.6% memory(298words)
adding the PWM component and use the Enable makro and the Set duty cycle makro pushed the memory to 52.3%
This is also the reason that my PIC1508 Ran out of memory,
Why is the PWM component using so much memory ?

Please can you compile the attached Flowchart and compare the memory use with and without the PWM component , it seams to me not correct tzat a single component use 50% of memory :shock:

Re: Missing prescaler setting Timer 2

Posted: Wed Jan 03, 2018 4:12 pm
by Benj
Hi Peter,

For me when I compile the program as was (enable and set duty macro calls present in the program) I get this memory usage.
Memory Summary:
Program space used 157h ( 343) of 2000h words ( 4.2%)
Data space used 7Ah ( 122) of 400h bytes ( 11.9%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Data stack space used 0h ( 0) of 37Ch bytes ( 0.0%)
Configuration bits used 2h ( 2) of 2h words (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
I've tried the default compiler and also the latest XC8, both in Free mode and the stats are largely the same.

I take it you're using Flowcode 7.3. Did you do a complete installation or did you install the patch?

Re: Missing prescaler setting Timer 2

Posted: Wed Jan 03, 2018 4:21 pm
by QMESAR
Hi Ben.

When I updated to 7.3 the page said that if you have 7.1 and higher you should only install the patch so I installed the patch,
I will do a uninstall now and do a new full installation

I am crazy with this stuff now :D

Re: Missing prescaler setting Timer 2

Posted: Wed Jan 03, 2018 5:12 pm
by Benj
Fingers crossed this solves the problem for you, let us know how you get on.

Re: Missing prescaler setting Timer 2

Posted: Wed Jan 03, 2018 5:38 pm
by QMESAR
Hi Ben.

Thank you for your support,
I did a full install and now I get the same values of memory usage as you.(PWM enabled and Duty cycle set )

I can kick myself as I did what your update page information was and it caused me big issues :D
Many Thanks Ben that you compiled and gave me a reference :D :D