PIC18F67K22 COMPONENT TIMER NOT RUNNING

Moderator: Benj

xelites
Posts: 44
Joined: Thu Nov 06, 2014 9:47 am
Been thanked: 7 times
Contact:

PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby xelites » Thu Jan 24, 2019 9:02 am

Hello everyone, I'm trying to use the timer component but it does not work, it creates an error in the simulation and the variables do not change. Is it my mistake or does the component have problems?
I enclose the program and I look forward to it.
Complete it with xc8 V2.0
thx all
Attachments
MTU_ECU_OK_FLUSSOMETRI.fcfx
(530.61 KiB) Downloaded 34 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1187
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 379 times
Been thanked: 604 times
Contact:

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby QMESAR » Thu Jan 24, 2019 9:13 am

Hi
The Flowchart you uploaded compile fine for me with V8,1,
I would recommend you to post a Flowchart with minimal code that shows your issue at the moment the Flowchart is big and many icons disabled
it hard to judge or see your problem.

P2.jpg
P2.jpg (198.11 KiB) Viewed 1596 times

xelites
Posts: 44
Joined: Thu Nov 06, 2014 9:47 am
Been thanked: 7 times
Contact:

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby xelites » Thu Jan 24, 2019 10:06 am

Hi Qmesar, it's not a compilation error ... the compiler says everything ok. Try the main program now simplified and you will see that the component when you bring to 1 the marker_01 does not count for 5-10 seconds and error.
Thanks again
Attachments
Timer_Component.fcfx
(523.81 KiB) Downloaded 40 times

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

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby Benj » Thu Jan 24, 2019 3:14 pm

Hello,

The Timer component doesn't currently have any simulation capability. However I have done a bit of investigation and managed to get it simulating quite nicely now.

I'll get the new component pushed out to the update system for you tomorrow as I'm out of the office today.

xelites
Posts: 44
Joined: Thu Nov 06, 2014 9:47 am
Been thanked: 7 times
Contact:

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby xelites » Thu Jan 24, 2019 4:06 pm

Thank you Benj .. I await tomorrow

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

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby Benj » Thu Jan 24, 2019 4:18 pm

You can test for now if you like by copying the attached file into your "C:\ProgramData\MatrixTSL\FlowcodeV8\Components" folder and restarting Flowcode.

Timer.fcpx
(36.42 KiB) Downloaded 49 times

xelites
Posts: 44
Joined: Thu Nov 06, 2014 9:47 am
Been thanked: 7 times
Contact:

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby xelites » Fri Jan 25, 2019 8:55 am

Yes, now running ... i go try
Thank you Benj :)

xelites
Posts: 44
Joined: Thu Nov 06, 2014 9:47 am
Been thanked: 7 times
Contact:

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby xelites » Fri Jan 25, 2019 9:36 am

Benj, I tried, the timer now counts part and stops, but the reset? how you do it ? it's possible
or I have to consider that when the program runs on the microprocessor giving the stop timer it resets and starts again?
Thank you

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

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby Benj » Fri Jan 25, 2019 11:15 am

Hello,

Many thanks I have been into the component again and now have created a new reset macro which can be called as well as adding a new parameter to the start macro to allow you to auto reset if you wish when starting the timer. This should give you a lot more control.

The latest component is now available via the update system.

Let me know how you get on.

xelites
Posts: 44
Joined: Thu Nov 06, 2014 9:47 am
Been thanked: 7 times
Contact:

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby xelites » Fri Jan 25, 2019 1:47 pm

I tried Benj, but the stopcounter of the module as I recall the simulator creates error

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

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby Benj » Fri Jan 25, 2019 5:49 pm

Hello,

What error are you getting? The component runs fine for me but is popping up the Error tab of the icon lists window, though this is empty.

I'll see if I can investigate what might be triggering this but if you ignore the icon lists window appearing it does seem to be running as expected.

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

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby Benj » Fri Jan 25, 2019 6:09 pm

Errors have now been found and fixed. They were to do with uninitialised variables in the simulation macros.

xelites
Posts: 44
Joined: Thu Nov 06, 2014 9:47 am
Been thanked: 7 times
Contact:

Re: PIC18F67K22 COMPONENT TIMER NOT RUNNING

Postby xelites » Sat Jan 26, 2019 11:58 am

ok Banj, now it works Tuesday I install it in the processor and see if it also works on the board. For now, thanks and good week :wink: