Hi,
Without seeing your actual code it's hard to tell what you're doing and if it's "the right way" or not. If it works then I guess it's OK.
But anyway, here are couple of random thoughts....
You don't need an array (in RAM) since the values are constants, use a lookup table (which stores the values in program memory instead of RAM). If the values you're looking up are WORDs you need to use LOOKUP2.As for the delay, again hard to tell what you're doing and I'm not sure I understand what the actual problem is. If you want higher output frequency (ie the sine output, not the actual PWM frequency) then reduce the delay between each update of the dutycycle. If the math doesn't add up, make SURE the PIC is running at the frequency you think it is.Code:i VAR BYTE DUTY VAR WORD MAIN: For i = 0 to 8 LOOKUP2 [100,123,234,345,456,789,890,1234,2345], Duty PDC0L = DUTY.LOWBYTE PDC0H = DUTY.HIGHBYTE PAUSEUS 800 NEXT GOTO Main
/Henrik.




Bookmarks