Open happytm opened 10 months ago
I'll update this when Timers are implemented. Currently, a bit-bang implementation is possible.
OK thanks. I will be waiting.
Thanks. Could you provide a similar example in C/CPP? For the IR transmitter, I think the following API should be sufficient for sending a well-formed protocol:
PwmOut::send(data: &[u16])
for sending a series of pulses(duty) using current frequencyPwmIn::read(data: &mut [u16])
for receiving. with edge trigger support.I have no similar example in C/CPP but there is a project in assembly linked below:
https://www.sbprojects.net/projects/ir-repeater/index.php
At the end of that page there is download link to download code and circuit schematic for PIC micro controller.
Thanks.
Thanks.
Hi @happytm,
At the end of that page there is download link to download code and circuit schematic for PIC micro controller.
This project you shared is using an NE555 to generate the 38kHz carrier frequency and doing a ASK modulation using a MOSFET. On MCUs with PWM output capabilities, the circuit can be further simplified and the time base circuit can be removed.
To control your IR diode using a PWM capable pin, set the PWM parameter to 20% duty with 38kHz frequency, then modulate the carrier signal output by configuring GPIO AF to GPIO/TIMER according to the baseband signal.
You have already shared the specifications of the IR remote protocol:
His blog linked below is treasure trove for ATTiny devices:
So what you have to do next is implementing the protocol by looking at the "Protocols" chapter of the above blog post.
Regards, Yilin Sun
@imi415 He is not using 555 timer at all. He is saying 555 timer is bad and reliable so he used PIC microcontroller.
I am new to Rust so if you can provide sample code for encoder/decoder I will appreciate it.
Thanks.
There is IR implementation for Rust but for other microcontrollers if it is any help to port it to CH582 chip.
https://github.com/jkristell/infrared
Thanks.
As you know I am very new to Rust language. With your help I just setup Rust environment couple of days ago.
Now I have new feature request. I was searching for IR transmitter solution for CH582F in Rust but could not find any. But came across a repository which implements IR transmitter for ATTiny13A micro controller and goes into detail of it's functionality. I think he uses timer functionality of ATTiny13A to create any custom IR protocol codes. The repository is linked below:
https://github.com/wagiminator/ATtiny13-TinyRemote?tab=readme-ov-file
He also have IR receiver implemented on ATTiny13A chip in another repository:
https://github.com/wagiminator/ATtiny13-TinyDecoder
His blog linked below is treasure trove for ATTiny devices:
http://www.technoblogy.com/show?24A9
One benefit of CH582F is it's builtin BLE. This makes it possible to use smartphone instead of buttons in above project to control any device in vicinity of IR transmitter. That can make very low cost home automation system.
Is it possible to implement this in Rust?
Thank you.