Psyfusion
Newbie level 5
Hi!
I'm trying to develop a system with two PICs. One receives analog input and outputs serial data with usart to another PIC. That one outputs PWM with a duty cycle according to the received serial data.
My problem is that i can't get the pwm to work correctly when using the serial interface. I'm using the usart in async. mode. I can control the duty cycle by anything else(like parallel input on 8 pins) and i can also control it by the serial port but only randomly. But it stops when the code is waiting for a start byte to sync the reception. The first received byte modifies the duty cycle but then nothing can change it(the program is running although)! Without waiting for a start byte it changes constantly.
Please help me if you can!
Thanx!
I'm trying to develop a system with two PICs. One receives analog input and outputs serial data with usart to another PIC. That one outputs PWM with a duty cycle according to the received serial data.
My problem is that i can't get the pwm to work correctly when using the serial interface. I'm using the usart in async. mode. I can control the duty cycle by anything else(like parallel input on 8 pins) and i can also control it by the serial port but only randomly. But it stops when the code is waiting for a start byte to sync the reception. The first received byte modifies the duty cycle but then nothing can change it(the program is running although)! Without waiting for a start byte it changes constantly.
Please help me if you can!
Thanx!