PWM input to output

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PWM input to output

655 Views
_tom_
Contributor I

Hello,

 

I am relatively new to Tower Systems and the control logic design as well. I am working on turning a Power Wheels toy into a RC car with some extras. I want to use a standard 2 channel Tx/Rx system to handle the drive and steering control. I have a receiver and have found that the output signal from it is a PWM signal with a frequency of 60 Hz, period of 16.4ms, and modulation width from 1.2ms to 1.8ms. I would like to have this signal input into my TWR-S12G128 and output if some conditions are met. Basically I want to use the tower to control whether or not the motor receives the signal. From the manual it looks like I can use PORT T to handle the input and output. can someone confirm this? Also is there anything particular I need to do in the code other than set the desired pins to I or O respectively and then make them = (PT2 = PT3, fro example)?

 

Thanks for any help on this!

Labels (1)
0 Kudos
2 Replies

369 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

port T is the best solution because it is a timer input. It provides you a possibility to measure pulse length to get required info about input. You do not care about frequency of the input pulses if the information carrier is absolute value of the pulse length.

If it is a manchester (NRZ) I do not know what is signal coding. If it is still pulse length then you can use, for example, external RS232 transceiver to change NRZ to (0;5)V. Such transformed pulse can be then connected to timer input capture pin to measure length of the pulse or to another input pin which is able to recognize input protocol (if any).

The same is valid in opposite direction just another timer pin is used in a output compare mode to generate proper pulse length or you can use some of the PortP pins if you want to use PWM output to generate pulse of defined frequency and pulse length. Also RS232 can transform (0;5)V signal to manchester NRZ format.

Best regards,

Ladislav

0 Kudos

369 Views
_tom_
Contributor I

I need to correct the question I posted above. I looked at the output signal from the RC receiver with my oscilloscope to determine what it is. The first time I looked it appeared just like I would expect a PWM signal to look like. However, after another look it is in fact a Manchester coding scheme signal. With that difference, does anyone have any suggestions?

0 Kudos