SONY FB IR switch with a PIC12F675
von
am 25.12.2023 um 08:31 (3092 Hits)
Testing a basic infrared remote control technique is likely the most well-known way to learn how to use a microcontroller. It's also a very common example. The remote controls are on the couch table, and there's always something to turn on, like the TV lamp, the Christmas lights, or maybe one day I'll use it to send a robot to the fridge. As a line follower, it only needs to follow the well-worn way...
basket random
When I took the SIRCS test, I used it as a chance to practice writing small PICs in C. I found the best Mid-Range PIC C code guides online. Microchip gives away the XC8, which also works pretty well in free mode.
In my example project, I'm testing the SIRCS-12 and using buttons to switch between 4 channels and do manual control in case of an emergency or test.
Main.c SIRCS_IR_Switch
With XC8 V 1.32 in free mode, the program is no longer very small, but it now takes up about 350 words in the program flash. The PIC12675's flash is just a bit more than three quarters full.
This makes me feel a lot better about using C with small PICs. I think it's clear that mid-range PICs can also be written well in C. At least if you don't want to use up all the storage and performance space. And if so, speaking more than one language makes life better...