Im back from university, I get new results, The A/D module is working fine I tested it loading the ADC result to a port C and A from pic, I used a led bar (10 leds) to check it, when I tested in PWM it work fine load the correctly value to duty cycle register, if I load 2.5 Volts in analog input, I get 50% from duty cycle in PWM output signal, my trouble now is that my signal is flickering a lot, some times stay some value for some seconds and after load other value, I think that FIFO buffer from ADC is doing wrong some thing, I changed my code today, Im using PWM interrup each time that PTMR match PTPER start the Hight priority interrupt routine service, in this interrupt service Im reading and loading the ADC result to duty cycle registers, I have attached my new code here, I have disallowed ADC interrupt.
I hope someone can help me, thanks.
Regards.
Bookmarks