![]() ![]() ![]() If you want to learn more about the CPU and it’s peripherals anyways, you can read the official documentation: BCM2835-ARM-Peripherals.Īfter digging a bit into the documentation and after a google search, reading lots of forum posts, i found an easy to use gpio library for the pi. Luckily the pi can do this! And with the help of well written high-level libraries you can easily create accurate PWM-Signals with software without having to know anything about the ARM-CPU or about PWM-Registers or about low-level programming. transmitting data? You’ll have to use a hardware generated Signal. Exact timingsīut what if you need the signal to be very precise? Let’s say with an inaccuracy of max. You won’t notice a difference, because the PWM-Signal is used to generate an average voltage. As mentioned above: This is absolutely no issue when dealing with e.g. It might take 1µs and the pulse gets accurate or it might take 127µs and the pulse is malformed. ![]() And this is the problem: The time is undefined. After an undefined period of time (might even take some ms to seconds) the OS will give your PWM-Program the focus again and it can generate some waveform output. Python script, which is doing the PWM work, will just get some time for doing it’s stuff before an other app gets it’s runtime. Without digging too deep into the topic of scheduling and multi-tasking let’s just say: the linux OS on the pi has to give itself and other applications, running on the pi, some time too for processing. This happens because of the way software runs on a computer. The pulses created by the RPi.GPIO Python-Library are not very exact (usually something like +/-100µs): Image 1: You can see the difference in the pulses. But for real-time and time-critical applications, this is actually an issue: This might not be a common issue, that hobbyists run into when creating their projects, because usually the software PWM, offered by the raspberry pi’s RPi.GPIO-Module, is exact enough for dimming some lights or controlling dc-motors. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |