Page 4 of 5

Re: IRlib on STM32?

Posted: Wed Jan 18, 2017 12:05 am
by victor_pv
I was looking at that last year, and have intention to continue when i have time to dig the files and then continue with it.

I was using the ST application note linked by Andy in the previous post. That AN is for F0 and F3 chips that include an internal circuit to connect 2 timer outputs, in a way that they will provide an output with the 56Khz, 48Khz, or whatever needed for the IR receiver used in the application.
The F1 lacks that internal circuit, but nothing prevents you from using 2 timer outputs and implementing the circuit on the PCB with a couple of transistors and little more. That was my approach.

I had the code half way translated from the STM std peripheral library to mostly libmaple, but like I said that was last year and I had to put it aside for a long time, so I don't remember how close I was to getting it to work. I remember I had to order IR leds and put it aside and started working on a wav player using a timer to generate a PCM output. I got that working, and I didn't feel the IR stuff was much more complex, but then didn't have time to back to it.
It can definitely use DMA, and I planned to turn to DMA as soon as I had it working, to reduce the CPU load.

I do not think it's complicated. Anyone with a bit of experience in C and the STM32F1 timers should be able to complete it faster than me.

Re: IRlib on STM32?

Posted: Wed Jan 18, 2017 10:27 pm
by GrumpyOldPizza
victor_pv wrote:I was looking at that last year, and have intention to continue when i have time to dig the files and then continue with it.

I was using the ST application note linked by Andy in the previous post. That AN is for F0 and F3 chips that include an internal circuit to connect 2 timer outputs, in a way that they will provide an output with the 56Khz, 48Khz, or whatever needed for the IR receiver used in the application.
The F1 lacks that internal circuit, but nothing prevents you from using 2 timer outputs and implementing the circuit on the PCB with a couple of transistors and little more. That was my approach.

I had the code half way translated from the STM std peripheral library to mostly libmaple, but like I said that was last year and I had to put it aside for a long time, so I don't remember how close I was to getting it to work. I remember I had to order IR leds and put it aside and started working on a wav player using a timer to generate a PCM output. I got that working, and I didn't feel the IR stuff was much more complex, but then didn't have time to back to it.
It can definitely use DMA, and I planned to turn to DMA as soon as I had it working, to reduce the CPU load.

I do not think it's complicated. Anyone with a bit of experience in C and the STM32F1 timers should be able to complete it faster than me.

Interesting note. Would one want a generic library, or something that can emit RC5 directly ?

Re: IRlib on STM32?

Posted: Thu Jan 19, 2017 12:11 am
by victor_pv
GrumpyOldPizza wrote:

Interesting note. Would one want a generic library, or something that can emit RC5 directly ?
The one I was trying to adapt, base on an application note from STM, can send RC5 and SIRC. I think I was working on the SIRC version, but both were very similar as far as most functions, only a different packet length and structure.
They both used a similar function to capture and send the individual bits, but different functions to format them.

Re: IRlib on STM32?

Posted: Sun Mar 19, 2017 9:09 pm
by KaraWin
Hi
I made an adaptation for irmp reception for stm32duino.

at https://github.com/karawin/irmp-master

Tested with the blue card.

Re: IRlib on STM32?

Posted: Tue Apr 11, 2017 9:53 am
by rexnanet
KaraWin wrote:Hi
I made an adaptation for irmp reception for stm32duino.

at https://github.com/karawin/irmp-master

Tested with the blue card.
Thanks! I was posting it on the forum and realized you already had done it :)
Have to test it ASAP! :)

Re: IRlib on STM32?

Posted: Sat Apr 15, 2017 7:35 pm
by KaraWin
Thanks! I was posting it on the forum and realized you already had done it :)
Have to test it ASAP! :)
Ok, let me know.

Re: IRlib on STM32?

Posted: Mon May 01, 2017 8:18 pm
by VadimEL
https://github.com/karawin/irmp-master
can not compile :( Maple mini (STM32F103CBT6)


Code: Select all

In file included from C:\Documents and Settings\Vadim\Мои документы\Arduino\hardware\Arduino_STM32\STM32F1\libraries\irmp-master-master/irmp.h:18:0,

                 from C:\HELP\07ELECTRONIK\09MK\20MY\40shpagi\05LCD touch\00progr\24ver\PVS\PVS.ino:165:

C:\Documents and Settings\Vadim\Мои документы\Arduino\hardware\Arduino_STM32\STM32F1\libraries\irmp-master-master/irmpsystem.h:98:22: fatal error: avr/io.h: No such file or directory

 #  include <avr/io.h>

                      ^

compilation terminated.

exit status 1
Ошибка компиляции для платы Maple Mini.

Re: IRlib on STM32?

Posted: Mon May 01, 2017 10:10 pm
by KaraWin
Something is wrong in your board selection.
You are in
#if defined(ATMEL_AVR)
case.

I made the modification for
#elif defined(BOARD_generic_stm32f103c)

Please change all BOARD_generic_stm32f103c to your mapple mini definition or better, add an ifdef or elif case.
Probably
if defined(ARDUINO_MAPLE_MINI)

They are at
Search "stm32duino" (3 hits in 3 files)
C:\Users\jp\Documents\Arduino\libraries\irmp-master\irmpconfig.h (1 hit)
Line 162: * Change hardware pin here for STM32Duino
C:\Users\jp\Documents\Arduino\libraries\irmp-master\irmpsystem.h (1 hit)
Line 44: #elif defined(BOARD_generic_stm32f103c) // STM32DUINO
C:\Users\jp\Documents\Arduino\libraries\irmp-master\irsndconfig.h (1 hit)
Line 170: * generic_stm32f103c(STM32duino, see IRSEND.ino)

Re: IRlib on STM32?

Posted: Tue May 02, 2017 1:19 am
by VadimEL
KaraWin
Thanks, it compile now. I change all to ARDUINO_MAPLE_MINI

Image


Ok found irmpconfig.h and change IN PIN to PA8

Code: Select all

 * Change hardware pin here for STM32Duino
 *---------------------------------------------------------------------------------------------------------------------------------------------------
 */
#elif defined(ARDUINO_MAPLE_MINI)  
#  define IRMP_BIT_NUMBER                       PA8                      // use C15 pin
and change HardwareTimer timer(2);
to
HardwareTimer timer(1);

and it WORK!!! :mrgreen: everyone laughs are all happy :mrgreen: :mrgreen: :mrgreen: Thanks for library =)

Re: IRlib on STM32?

Posted: Tue May 02, 2017 7:59 am
by KaraWin
Yes, you may delete the comment, it is a test to learn many way to implement a timer.
and it WORK!!! :mrgreen: everyone laughs are all happy :mrgreen: :mrgreen: :mrgreen: Thanks for library =)
Great. Enjoy.