Elektroda.com
Elektroda.com
X
Elektroda.com

System for 1 USD * - TV remote control by piotr_go

piotr_go 7152 68
This content has been translated flag-pl » flag-en View the original version here.
  • System for 1 USD * - TV remote control by piotr_go

    Hello, after a long break. This time the Chinese ... chip from Taiwan was used to build an IR remote for TV from LG.
    The remote control can turn on / off the TV, change the channel or the volume. The number of functions has been limited due to the small number of IO of the microcontroller.
    The used PFS154 can be changed to PMS150C after a slight modification of the program.

    Codes:
    To find out how the original remote control works, I connected an analyzer to its transmitting diode.
    The pilot transmits at a frequency of 38 kHz. First there is a longer start bit, then 8 data bits + the same 8 bits only inverted, then another 8 data bits + negated 8 bits, finally a short stop bit.
    Holding the key down causes sending a slightly different start bit every 100 ms without additional data.

    The frequency of 38 kHz is generated by software:
    Code: avrasm
    Log in, to see the code




    Similarly with "emptiness":
    Code: avrasm
    Log in, to see the code


    In the "a" register, the signal length.

    Diagram:
    System for 1 USD * - TV remote control by piotr_go

    I gave up the diode current limiting resistor :P .
    The current capacity of the pin at a short-circuit to plus 3.3 V is 24 mA (measured).





    * in before covidowo / wojnej currency, 2019 BC (before covid)

    Cool? Ranking DIY
    Can you write similar article? Send message to me and you will get SD card 64GB.
    About Author
    piotr_go
    DIY electronics designer
    Offline 
    piotr_go wrote 2478 posts with rating 2704, helped 88 times. Been with us since 2003 year.
  • #2
    spec220
    Level 28  
    piotr_go wrote:
    The current capacity of the pin at a short-circuit to plus 3.3 V is 24 mA (measured).

    It is a bit unprofessional to load the pin of the microcontroller with a current exceeding 20 mA. I understand that the LED current is limited by the microcontroller gate protection, because the voltage drop on such an IR emitting diode is from 1.1 to about 1.2 V
    Connecting such an LED directly to the 3.3 V line will just burn it, unless you are transmitting a LED with a similar voltage drop as the blue LED.
  • #3
    piotr_go
    DIY electronics designer
    spec220 wrote:
    It is a bit not professional to load the pin of the microcontroller with a current exceeding 20 mA

    The Chinese like to connect 7-segment displays without resistors. These microcontrollers have a programmable IO current capacity.

    spec220 wrote:
    Connecting such an LED directly to the 3.3V line will simply burn it

    IR LEDs consume quite a lot of current> 20 mA
    If I counted correctly, at 3.3 V it will be something like 16 mA. So that the stock is there.
  • #4
    ArturAVS
    Moderator HP/Truck/Electric
    piotr_go wrote:
    The Chinese like to connect 7-segment displays without resistors.

    But they have very bright displays that even hit the eyes at a few mA. Beautiful tomcat. :D
  • #5
    piotr_go
    DIY electronics designer
    ArturAVS wrote:
    But they have very bright displays that are already at a few mA

    What on the common anode / cathode gives ...

    I would not connect to AVRk like that. Apparently you can.
  • #6
    NegativeFeedback
    Level 12  
    Well, in fact, such a 'you can because you can', but I have also done such recently, one of the thermometers will flash the temperature with green and red LEDs, and red blinking non-stop when it is 30 C. And recently it is also an anti-screensaver, every 10 minutes it 'presses' the Num Lock key. Both are equally useful I think :) Both on MSP430.

    ps red paws and snout fall, sweetheart after the hunt?
  • #7
    piotr_go
    DIY electronics designer
    Out of curiosity, maybe I will test how much they can withstand a short circuit.
    I used to tire 3V Chinese ARM above 7V. It didn't die, it just turned off. Until 7 V, he walked normally, he did not even heat up.

    NegativeFeedback wrote:
    after a hunt?

    2 they are one hunted for the other.
    Several times I saw them asleep with their eyes open. :)
  • #8
    spec220
    Level 28  
    piotr_go wrote:
    spec220 wrote:
    Connecting such an LED directly to the 3.3 V line will simply burn it

    IR LEDs consume quite a lot of current> 20 mA
    If I counted correctly, at 3.3 V it will be something like 16 mA. So that the stock is there.

    16 mA it would be if some limiting resistor were used in the US.
    If it is a gate current stabilization, then by subtracting the voltage drop across the LED, there is still more than 2 V of reserve, and thus the original 24 mA should flow, ie when the trunk is shorted to "+".
  • #9
    piotr_go
    DIY electronics designer
    spec220 wrote:
    16 mA it would be if some limiting resistor were used in the US.

    I would not expect a built-in current source from a 3 cent chip.
    16mA after taking into account the decrease in the LED, 24 mA without the LED.
    Although I admit that I did not measure with the LED. I'll check in a minute and let you know.


    Added after 22 [minutes]:

    OK, I admit without hitting, 23 mA with LED. I did not expect. Good to know. In PDFs I usually see a voltage dependent value. Hence my mistake.
    But I also "made a mistake" with the LEDs. TME apparently gives the test value instead of the nominal one (test value 20 mA, nominal 50 mA, impulse current up to 1.2 A).

    Added after 41 [minutes]:

    And one more test. When powered by 5V, the current on the 40mA pin, with and without LED.

    Short circuit current sink on:
    PA0 55 mA
    PA3 55 mA
    PA4 55 mA
    PA5 40 mA
    PA6 36 mA
    PA7 36 mA

    Short-circuit current source on:
    PA0 44 mA
    PA3 44 mA
    PA4 44 mA
    PA5 0 mA (I did not break it, it's the reset pin)
    PA6 44 mA
    PA7 44 mA

    Tested chip: PFS154.
  • #10
    spec220
    Level 28  
    piotr_go wrote:
    And one more test. When powered by 5V, the current on the 40mA pin, with and without LED.

    With a higher voltage, the internal value of the reference voltage rev probably also changes. hence a higher but stable value of the gate current for different loads. As long as it is programmable, ie in AVR etc. You can reduce the current out.
  • #11
    piotr_go
    DIY electronics designer
    IO current can be set to normal, low and pull-up.
    I only measured normal.
  • #12
    spec220
    Level 28  
    piotr_go wrote:
    IO current can be set to normal, low and pull-up.
    I only measured normal.

    Which means that whatever you set, its value will always depend on the nap. power supply, not the load, unless there is a voltage drop. the load resistance will be so large that the source will not have enough to stabilize the current. then its value will depend on this decrease and the nap. power supply.
  • #13
    piotr_go
    DIY electronics designer
    My guess is there must be more than a single transistor shown in the PDF.
  • #14
    spec220
    Level 28  
    The transistor shown is a gate / port skeleton only. Probably the PDF contains a simplified / block architecture of the processor itself, so that it is known what it looks like from the perspective of the US implementation itself to the specific needs.
  • #15
    piotr_go
    DIY electronics designer
    I tired PA5 set to 0 and shorted to +.
    After an hour on 3.3V and 5V power supply. The short-circuit current is still as it was.
  • #16
    spec220
    Level 28  
    If there was the same mA at a short circuit for 3.3V and for 5V, then you had to configure a stable internal ref source somewhere. either in coffee grounds or in code. I don't know this US, nor have I viewed the PDF.
    For example, in AVR you can choose an internal source, or, if you want, an external one, although modern microcontrollers have a built-in rev that is stable enough that for simple applications you do not need to use anything outside.
  • #17
    Mlody_Zdolny
    Level 23  
    The PFS154 just has a global setting for all Low / Normal current output pins, something like fuses in the AVR.
    In PFC460, individual Normal / Strong pins can be individually set in a dedicated IOHD register.
    There is hardly any Vref involved in the current limiting. Most likely this is done with two parallel end stages toggled on and off with Code or IOHD.
  • #18
    piotr_go
    DIY electronics designer
    spec220 wrote:
    If there was the same mA at short circuit for 3.3V and for 5V

    Same as an hour ago. Nothing has fallen.

    spec220 wrote:
    For example, in AVR you have the choice of an internal source, or, more precisely, an external one

    I will emphasize right away that I do not know the newer AVRs very much.
    In AVR, is this internal reference used for IO? It eats up a lot of electricity. Some link maybe because I got lost.
    In older ones, I associate the tables with the IO current depending on the power supply.
  • #19
    spec220
    Level 28  
    Mlody_Zdolny wrote:
    There is hardly any Vref involved in the current limiting. Most likely this is done with two parallel end stages toggled on and off with Code or IOHD.

    The value of the output current can be adjusted by software, but to keep a stable parameter, it must have a hardware pattern ...
  • #20
    Mlody_Zdolny
    Level 23  
    spec220 wrote:
    maintain a stable parameter

    Where do you say that this is a stable parameter?
    The Iout characteristic as a function of Vcc is almost the resistor characteristic.

    System for 1 USD * - TV remote control by piotr_go

    It is enough to connect the end stages with the appropriate transistors.

    System for 1 USD * - TV remote control by piotr_go
  • #21
    spec220
    Level 28  
    Mlody_Zdolny wrote:
    Where do you say that this is a stable parameter?

    spec220 wrote:
    If it is a current stabilization of the gate, then by subtracting the voltage drop on the LED, there is still more than 2V of the reserve, and thus the original 24mA should flow, i.e. when the trunk is shorted to "+"

    piotr_go wrote:
    OK, I admit without beating, 23mA with LED. I did not expect

    piotr_go wrote:
    After an hour on 3.3V and 5V power supply. The short-circuit current is still as it was.


    Even if you want to switch on individual branches, you still have to refer to something to maintain the set current. By the way, there are 3 branches, because there are 3 different thresholds for the load capacity of the output itself, while the same current stability in a given threshold is responsible for the source that will prevent the maximum current value from being exceeded for this threshold.
    Such a source can even be a properly constructed gate, which is commonly known from JFET technology, where such transistors were used as reference sources.

    Regards.
  • #22
    piotr_go
    DIY electronics designer
    @ spec220
    I will repeat again. After an hour, the current was the same as at the beginning of the test, not the same for 5V as 3.3V.
    What is this internal / external reference in the AVRs about? Any link maybe?
  • #23
    spec220
    Level 28  
    piotr_go wrote:
    What is this internal / external reference in the AVRs about? Any link maybe?

    I don't have a link, but a compiler that gives you this option.
    Generally, I connect Vrev to + Uz US through the LC filter. As long as the US itself will be stably powered, the Vrev will be relatively stable for simple applications.
    If you want some links, talk to tmf, or someone who is in it on a daily basis ... I specialize in analog.

    piotr_go wrote:
    I will repeat again. After an hour, the current was the same as at the beginning of the test, not the same for 5V as 3.3V.

    Approx. But you wrote that at the same voltage, the current was the same with the LED and directly to + Uz
  • #24
    ArturAVS
    Moderator HP/Truck/Electric
    spec220 wrote:
    Generally, I connect Vrev to + Uz US through the LC filter.

    You pin it voltage reference input for ADC which has nothing to do with the outputs. For the outputs, no Vref is needed (because why the hell should ADC be involved in it?), Here, as a last resort, factory calibrated current sources are enough, where the reference resistor is switched accordingly depending on the requirements.
  • #25
    spec220
    Level 28  
    ArturAVS wrote:
    You connect the ADC reference voltage input that has nothing to do with the outputs. For the outputs, no Vref is needed (because why the hell should ADC be involved in it?), Here, as a last resort, factory calibrated current sources are enough, where the reference resistor is switched accordingly depending on the requirements.

    After all, I have not written anywhere that I connect Vrev to the exits? I've just given an example of a generic Vrev implementation

    However, in this case it is about something else, or rather protection of the maximum current for the selected threshold. Since it stabilizes the current, it must have a reference source? (not necessarily programmable, because gate / port current overload protection is usually not programmed)
  • #26
    BOOM i ZONK
    Level 21  
    Well, it does NOT stabilize its current! The current depends on the VCC. It is the internal resistance of the PULL-UP transistor (s) that limits the current.
  • #27
    spec220
    Level 28  
    Resistance is not an option, because the current at the same voltage would change with the external resistance. The only thing that can be is the proper construction of the goals themselves.
  • #28
    piotr_go
    DIY electronics designer
    spec220 wrote:
    piotr_go wrote:
    I will repeat again. After an hour, the current was the same as at the beginning of the test, not the same for 5V as 3.3V.

    Approx. But you wrote that at the same voltage, the current was the same with the LED and directly to + Uz

    I don't think we understood each other. :)
    The "sink" current was dependent on the microcontroller VCC and not on the voltage on the IO (VCC - V_LED) which surprised me. I was expecting a decline.
    I have never used an IO as a current source before.

    spec220 wrote:
    I don't have a link, but a compiler that gives you this option.
    Generally, I connect Vrev to + Uz US through the LC filter.

    This, as ArturAVS wrote, is for ADC / comparator. Nothing to do with IO.

    BOOM i ZONK wrote:
    The current depends on the VCC. It is the internal resistance of the PULL-UP transistor (s) that limits the current.

    There is a stabilization dependent on VCC. At least that's how it turns out in tests.
  • #29
    spec220
    Level 28  
    piotr_go wrote:
    This, as ArturAVS wrote, is for ADC / comparator. Nothing to do with IO.

    But that's not what I meant. At the beginning, I thought that there is a specific design that allows you to set the exact value of the output current, but meanwhile there are 3 levels whose stability depends on VCC and not on Robc within the stabilization limits.

    piotr_go wrote:
    There is a stabilization dependent on VCC. At least that's how it turns out in tests.

    I do not know how it is built, but if an ordinary voltage divider will serve as Vrev, the current will actually be stable for different resistance, but depending on the voltage. while.
  • #30
    piotr_go
    DIY electronics designer
    You wrote about internal reference in AVRs for outputs so I was surprised.

    spec220 wrote:
    if an ordinary voltage divider will serve as Vrev ...

    And it probably is.