Skip to content
Permalink
8fd85b3018
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
51 lines (32 sloc) 2.27 KB

Low-Profile Vessel RC Receiver PWM Pulse Width and Frequency Measurement on TM4C123GXL Launchpad

  1. IDE Toolchain: Keil MDK 5.3x & Keil MDK Legacy
  2. Hardware Platform: TM4C123GXL Launchpad

Notes: TivaWare & utilities are also contained in this repository.

Libraries used: TivaWare Firmware Library

PF3 - Heartbeat - Green LED flashes every 500 ms

Timer3A - 32bit free running downcounting, it is used for timestamp

WTIMER1 and WTIMER2 are initialized to capture rising and falling edge events, respectively. Interrupts are triggered to record the timestamps of these two edge events. Consider 32-bit overflow when calculating frequency and high period for WTIMER1 and WTIMER2.

PWM signal (3.3V) should be connected to WT1CCP0 - PC6 and WT2CCP0 - PD0

This program converts RC PWM signals to UART output.

Standard RC pulses are just a specialized form of PWM. A typical RC servo expects a signal every 20ms, however, this can vary from servo to servo. The pulse itself most often ranges from 1 ms to 2 ms, with 1.5 ms being the neutral position.

For Pulse 1ms, UART output to 0x00. For pulse 1.5ms UART output to 0x80. For Pulse 2ms, UART output 0xFF.

For RF signal 50 Hz, High = 1-2ms, not tested, it should work; not tested yet.

For testing, High period= 1ms = 500 Hz (1Khz), High period = 2ms = 250 Hz;

OR: RC signal 20 ms = 50 Hz for 1ms, duty cycle = 1/20 = 5% for 2ms duty cycle = 2/20 = 10%

// convert RC 1-2ms Pulse to UART output to control trolling motor // The output interfaces with MaterMotor PN00218 https://makermotor.com/pn00218-cyt20-motor-driver-160amp-8v-28v-dc-smartdrive-mds160a/ to control trolling engine // One RC channel signal (PWM) 1-2ms needs to level shifted to 0-3.3V and conntect to the TI EK123GXL launchpad PD0 and PC6 (also ground). // For 1ms, UART output 0x00 // for 2ms, UART output 0xFF // For deployment, define DEBUG false #define DEBUG false, // UART0 is used for testing // UART1 is used for deployment PB1 and Ground

01/04/2024 Tested on 0-3.3V 50 Hz, 5% - 10% duty cycle inputs. Correct output in the UART can be generated every 1 s (it can be programmed depending on the needs).

Inputs: RC channel signal inputs: PD0 and PC6, ground, RC signal needs to be shifted down to 0-3.3V Outputs: UART1 RxD - PB0, Txd - PB1 0-3.3V, and Ground