Hmmm - possible with exceptions.  A PWM waveform can be generated
using a UART by transmitting the same character over and ensuring that
it is sustained at 100% (no gaps between characters).  This is VERY
dependant on the type of hardware installed in the system, the
baudrate you're using, and the speed of the system.

The general principle is to select chracters that when placed
back-to-back, generates the waveform you're looking for.  Setting the
COM port to 8N1, you get a start bit and a stop bit, and you control
the bits in between.  So, if you want to transmit a 10% PWM, you
transmit 0x00, and a 90% PWM would be transmitting 0xFF (remember,
RS-232 data is "inverted" with negative voltage being a mark, positive
being a space).

To go inbetween in steps of 10%, you could write 0x80, 0xC0, 0xD0,
0xF0, 0xF8, 0xFC, 0xFD, and 0xFF.  UART data frames are start bit
('0'), D0-D7, stop bit ('1').

I routinely use the UART to generate a square wave by writting 0x55
over and over - very handy.

Hopefully you have a scope as that will greatly help in setting this
up.

Reply via email to