IRLibrary at 8 Mhz

Hello, I recently ran into a problem which forced me to run my atmega328p-pu at 8 mhz. I was planning to use a 16 mhz crystal to make an IR remote, but since i now have to run at 8 mhz i am pretty concerned about this. Will the IR library work with 8 mhz, or do i have to modify the source code?

you probably need to adjust timing if it is calculated with clock ticks. can't check as I cannot see the actual code used...

you can do this ,, i did some things with smal 8 mhz and 16 mhz things depents what you need it to do ,, do you want to recieve IR codes ? and tx them ? i had same isue on a 433 mhz tx/rx , i remember i changed the timing just like robtillaart explained ,,

It is the job the receiver class to monitor this signal and to determine the length of the pulses known as “marks” in the length of the intervening idle periods known as “spaces”. The hardware receiver devices typically are normally high and the low when a signal is received. However the code compensates for this sort is useful to think of a “mark” as being “on” and a “space” as being “off”. The duration of marks and spaces is measured in microseconds (1/1,000,000 of a second). Note however that the software makes use of the built-in Arduino function “micros(void)” which returns results in four microssecond granularity. Which means that values are always a multiple of four. This is for typical 16 MHz clocks on most Arduino models. On 8 MHz models results are in eight microsecond granularity. So whatever results we achieve are going to be no more accurate than that.

maybe this helps

I need to both send and receive IR, and i will of course edit the code, but my question was that will these received/sent codes be influenced by the speed of the atmega, consodering i adjusted the library to work at 8 mhz?

i think you need to upload it to test it ,, but i think it wil work i normaly would have test it ,, butt i have no 8 mhz ic left :grin:

when you recieve a code , and its a baudrate not accepted it wil stil recieve a code ,, butt maybe different then the 16 mhz version ,, but stil usable ,, to rec and play again ,, its like this ,, it records the pulses , and you read out the digits ,, let say 200,300,300,200,50,50 wil be some like 144100 .. when i recieve this in dubble speed ,, it wil be 100,150,150,100,25,25 ,, and when i transmit i it it wil be the same pulses of light transmiting back ,, little bit like this ,,, LOL if i record slow and play fast , you wil hear your sound twice as fast ,, if i record fast ,, and play same speed it wil be eqeul ,, when i play twice the speed it wil be also twice as fast ,,, so it do mater if you recieved the codes and decoded them in 16 mhz , and use them in 8 mhz ,, they can be different , butt this is theory ,,

Oh great, ill just test it out with 8 mhz and see what i get. Thanks for help! :grinning: