Hi all,
I'm new to PIC programming, but I want to create a very simple software PWM which will controll 2 servos according to the data received via RS232. I am using the PIC16F628.
The data will arrive at the USART in the following format:
**broken link removed**
Obviously the first byte can be discarded once received. The second byte determines which pin of Port B to use. The third byte determines the position of the servo addressed in byte 2.
The value of byte 3 can range from 0 to 255 (with only odd numbers being used to simplify it) so that 0 = 1ms pulse, 255 = 2ms pulse. I
Is a lookup table with 128 lines needed or is there a simpler way of doing it?
Also, can the timer value be adjusted with such accuracy, as the difference between pulses is around 0.0078125ms?
Any help is greatly appreciated, as this is getting over my head[][]
The PCB is built and simplified schematic can be seen by clicking on the following thumbnail:
**broken link removed**
Thanks,
Gareth
I'm new to PIC programming, but I want to create a very simple software PWM which will controll 2 servos according to the data received via RS232. I am using the PIC16F628.
The data will arrive at the USART in the following format:
**broken link removed**
Obviously the first byte can be discarded once received. The second byte determines which pin of Port B to use. The third byte determines the position of the servo addressed in byte 2.
The value of byte 3 can range from 0 to 255 (with only odd numbers being used to simplify it) so that 0 = 1ms pulse, 255 = 2ms pulse. I
Is a lookup table with 128 lines needed or is there a simpler way of doing it?
Also, can the timer value be adjusted with such accuracy, as the difference between pulses is around 0.0078125ms?
Any help is greatly appreciated, as this is getting over my head[][]
The PCB is built and simplified schematic can be seen by clicking on the following thumbnail:
**broken link removed**
Thanks,
Gareth