Missing prescaler setting Timer 2 [Solved]

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

Post Reply
User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Missing prescaler setting Timer 2 [Solved]

Post 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
Attachments
12.jpg
12.jpg (44.37 KiB) Viewed 3898 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Missing prescaler setting Timer 2

Post by Benj »

Hi Peter,

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

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Missing prescaler setting Timer 2

Post by QMESAR »

Thanks a million Ben :D

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Missing prescaler setting Timer 2

Post 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:
Attachments
AC Firmware FC V2.rar
(131.51 KiB) Downloaded 184 times
2.jpg
2.jpg (34.18 KiB) Viewed 3887 times
3.jpg
3.jpg (33.62 KiB) Viewed 3887 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Missing prescaler setting Timer 2

Post 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?

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Missing prescaler setting Timer 2

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Missing prescaler setting Timer 2

Post by Benj »

Fingers crossed this solves the problem for you, let us know how you get on.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Missing prescaler setting Timer 2

Post 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
Attachments
1.jpg
1.jpg (35.85 KiB) Viewed 3870 times

Post Reply