I have a routine running in the background generating a 2khz pwm using TMR0.
I want to use Serout2 to send out some data but the interrutps corrupt the flow of data going out on Serout2.
To make it work I am having to disable the interrupt driven pwm, send the data then restart the pwm as in the below.
The problem is now the stopping of the 2khz pwm is causing problems in the associated hardware, it is noticing the missing pulses. To minimise that i have reduced the data I'm sending to the bare minimum, but the gap in pwm is still slightly noticeable. What I wanted to do is move the data I need to send into an array and then send one byte at a time which would allow the pwm to continue virtually unaffected as the many small gaps would be absorbed rather than the one big gap in the pwm stream i have now. Any ideas on how to get the formatted data from my Serout2 into an array or some other RAM location.Code:TMR0IE = 0 'Disable TMR0 interrupt enable bit (0 = Disabled) serout2 AssistLed,16390,["DATA,TIME,",#Volts,",",AmpSign,",",#Amps,",",#Soc,",",#TempAvg,13] 'Sends logging data at 38400 baud TMR0IE = 1 'Enable TMR0 interrupt enable bit (1 = enabled)
I can't use HPWM that is already in use driving an LCD.







Bookmarks