Timers are not accurate -> TSC1 issues

Discuss issues and ideas you have to configuring displays with PowerVision
verschuren
Posts: 79
Joined: Wed Oct 28, 2015 8:40 am

Timers are not accurate -> TSC1 issues

Post by verschuren » Mon Oct 16, 2017 3:46 pm

Hi,

It looks like my timers are jumping all over the place and I was wondering if this was due to a high CPU load? I'm using the PV480 and see the load go up to 90%.

I suspect my TSC1 checksum issues are related to this. I calculate the rolling counter and message checksum with state machines and use FFCAN to transmit this at preferable 20ms.

Found that using the library it seems to work good without the checksum and rolling counter (set fixed at FFh) if I set the rate at 8 ms. With CANCapture it actually measures around 13 ms instead of 8 ms. I'm ok with using the library, but I don't know how to implement the rolling counter and checksum calculation into this. I suspect I will have issues using a different timer for the calculations and the message would not be in "sync".

I could use some advice on getting the timers more stable. I'm thinking about the following:

- Reduce CPU load -> What is the best way?
- Implement rolling counter and checksum calculations in TSC1 and transmit by using the library / transmit function if possible.

Thanks!

Mario
Mario Verschuren
Controls Integration
boyce
Enovation Controls Development
Enovation Controls Development
Posts: 322
Joined: Wed Sep 08, 2010 5:09 pm

Re: Timers are not accurate -> TSC1 issues

Post by boyce » Mon Oct 16, 2017 4:52 pm

CPU load is definitely an issue when using high speed timers. The simpler the configuration the better the results will be. Ideally, the CPU load should be under 50% so the system has enough resource to be responsive. Make sure to optimize any looping in state machines, activity diagrams and scripts. If something is looping, even with a timer, and does not complete then it could be holding the queue and not allowing something else to run. Sometimes queuing contention can result in lower CPU load (Bad when the CPU is needed).
Using the library transmitter is a good way to have more reliable transmit rates but it does not have a way to calculate fields like a message counter or a checksum per message. To manage the data per message will require using a high speed timer and Free Form CAN, probably what you are trying to do. It will take a close examination of each piece of the configuration to make sure everything is done as efficiently as possible and is absolutely required. You want as few timers as possible.
Boyce Schrack
Enovation Controls
verschuren
Posts: 79
Joined: Wed Oct 28, 2015 8:40 am

Re: Timers are not accurate -> TSC1 issues

Post by verschuren » Tue Oct 17, 2017 8:05 am

Thank you Boyce for your answer. I will do some digging and try to clean things up a bit. See how it will work from there.
Mario Verschuren
Controls Integration