Page 1 of 1

Cyclic messages

Posted: Thu 9. Dec 2021, 15:24
by c.litke
Hi PEAK Forum,

I am currently developing custom firmware for the PCAN-Router Pro, using the PCAN development kit.
As part of my development I'm trying to send out cyclic status messages every 20 ms, Ideally, I would set up an independent thread sending out defined messages.
How would I go ahead to do that? How do I set up cyclic messages using the dev kit?
I can't find any option for timekeeping in smaller increments than seconds in the lpc22xx.h to test against, and creating threads does not seem possible unless I port my entire project to C++.

Regards,
Litke

Re: Cyclic messages

Posted: Thu 9. Dec 2021, 16:16
by M.Heidemann
Hello,

Have you taken a look at the timer example provided with the PEAK-DevPack yet?

You can find it in :

PEAK-DevPack\Hardware\PCAN-Router_Pro\Examples\03_TIMER

Download Link PEAK-DevPack:
https://www.peak-system.com/quick/DLP-DevPack

The timer implementation shown here can easily work in the milliseconds
range (Depending on the load otherwise) and does not require threads to work.

Best Regards

Marvin