AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Arduino delay non blocking8/8/2023 ![]() with VHDL or Verilog, and combine it with a soft CPU or hard CPU on the FPGA for the firmware, depending on the FPGA. You could implement a custom frequency generator with step count etc. this 4 channel ADC with 8 bit and 10 MHz samplerate. I've done a few projects with FPGA devboards, e.g. for my entry level skill) and I have to control a display with 3 LED and 4/5 types of events and status. But in this case I would probably use a FPGA. Guide to code for multitasking and non blocking timers Asked 8 years, 8 months ago Modified 3 years, 8 months ago Viewed 15k times 0 I'm beginning to do kind of sophisticated things (well. Maybe a faster microcontroller could do it, like a STM32, which runs with more than 100 MHz depending on the type. If you want to count the steps as well, it gets complicated. There are cheap boards at eBay which you can just connect to an Arduino, and there are lots of demo projects for it on the internet. Internally it uses the same phase accumulator concept, but with a much higher clock rate, so jitter would be very low, especially at frequencies far away from the max frequency. It can generate a clock with up to 12.5 MHz, adjustable in 0.1 Hz steps. As the name implies, the Arduino will stop most of whatever it’s doing and wait for the delay()-function to finish before executing other code. Delay() is widely known as a blocking (or synchronous) function call. An alternative would be the AD9833, if you don't need to count the steps. Using delay() is not suitable for more complex projects, and this article explains a few alternatives you can use instead. But the resolution wouldn't be that fine anymore (the higher the frequency, the larger the Hz steps, because it divides the main clock by an integer). This will also result in no jitter, which is caused by the interrupt latency and the software phase accumulator implementation. The vTaskDelay () instruction pauses the task from which it is invoked, so in the case of Arduino, if I call delay () inside loop () it will pause most of the things. If you need higher frequencies, but don't need to count the individual steps, you could try the Arduino tone function, or programming the ATmega timer registers directly to avoid the gaps between consecutive tone calls. 1 Like cotestatnt October 20, 2022, 11:14am 5 Idahowalker: which is a non-blocking delay Im not sure its correct to say this. One thing i do note is that the pulse O/P seems to be jittery, regardless if original code or not. The Hi res encoder is of course part of the speed issue. At the mo the Gecko drive is set to multiply incoming pulses x 10 to get the rpm achieved.(1350). scaling but would be great if i could get 60 to 80 kHz. i have entered the tweek code as above, after fiddling with the poti*. i have to admit i did succeed at altering the pin assignments,
0 Comments
Read More
Leave a Reply. |