[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


This forum is read only and new users cannot register, please ask all new questions either using GitHub discussions, or in Arduino forum tagging @davetcc.

Many fast interrupts RSS feed
Forum Index » tcMenu Arduinio library
Author Message
zemens


Joined: May 30, 2022
Messages: 1
Offline
Hello! I hope for your advice. I set out making a controller for robertsonics WavTrigger sampler over serial based around tcMenu. Foolishly i chose a NodeMCU as a controller and now i am kind of deep and don't want to swap it. I already made another one using an arduino uno and it went easy. but with this one i am stuck. The catch is that it needs to send serial commands very rapidly and sometimes in very long bursts. I have a i2s oled using u8g2 library, a rotary encoder and an extra back button that i added using "switches". those work fine. then i tried adding a trigger using direct interrupts, switches.. no matter what i try, either the response is too slow or the controller crashes shouting wdt reset when i run those long bursts. would you please help me understand how to approach this?
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
This is a little outside the scope of the forum but I’ll do my best. The watchdog timer is to ensure that your code yields to the Wi-Fi library every few milliseconds. If you’re not using Wi-Fi one option would be to turn it off.

However, that aside you may need to transfer the serial data in smaller batches yielding between each batch. Maybe you could use a raw (not marshalled) interrupt and fill a circular buffer (SimpleCollections) in the interrupt with the data. Then have either a frequently running task or event that reads the circular buffer and sends data in batches. There’s no magic wand for these cases, but you’ll probably need to check if serial is going to block before calling write using availableForWrite.

Also if you’re using tcMenu with the u8g2 library over i2c ensure the low latency option is ticked.
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.