This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TM4C123GH6PM: Keil

Part Number: TM4C123GH6PM

Tool/software: TI C/C++ Compiler

data is transmitted by sending high frequency(100kHz)  signal corresponding to bit 1 and low freq, signal(50kHz) for bit0. Data bits are transmitted at rate of 1kbps. How to do that? What to write in ISR?

  • Muhammad Usman Qadeer said:
    What to write in ISR?

    Just the ISR?   Everything else - "A-Ok?"   (I think not.)

    PWM generator seems prime for such task.   You'll need to switch the (frequency) parameter to achieve (either) 100KHz or 50KHz w/in the PWM Frequency Set Command.

    Your "1Kbps" rate means each bit is active for 1mS.   That 1mS is likely to result from your set-up of an MCU Timer which first "reads" your data - then loads the appropriate (frequency) value w/in the API Command previously mentioned.  Thus - your Timer's ISR causes a data read, data track (which bit is being processed), then loads the PWM Frequency parameter, and only then - outputs the PWM for 1mS.  (on a "bit by bit" basis)   (there may be a less efficient means to transfer data - but what you've described is surely a leading candidate...)

    "How to do that?"   Good read of the MCU manual and the Peripheral Driver User Guide - and of course, "Use the API - NOT Direct Register!"   Examples abound both for Timer & PWM Set-Up & application - they appear under: Peripherals/Examples/etc.

    Target device (not revealed) must be (highly) specialized to require such (involved & s l o w) data.