16f628a code bug

Hello, I am using an older PIC 16f628 microcontroller to generate sine waves using a lookup table to calculate the sine function, and I want to use the 16f628a instead, but the lookup table function is mysteriously being called with excessively large w register values that overrun the end of the table causing glitches in the waveform. Is it possible that since my table is located at address 0x02 (I think) that something like an interrupt could be occurring unexpectedly that enters the table? I do not have problems with any other programs on these new chips, only when I try to use a lookup table. And I have positioned the table between program memory boundaries.

Thanks, jan

Reply to
jan
Loading thread data ...

Hi,

The interrupt for that chip is at location 4. An iterrupt to that address would not 'glitch' the sinewave - it would crash the system.

If you post your code here, I'll be glad to look it over.

--
Luhan Monat (luhanis 'at' yahoo 'dot' com)
"The future is not what it used to be..."
http://members.cox.net/berniekm
Reply to
Luhan Monat

See document DS40048A for migration information.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Thanks guys, I added a couple lines of code to process any interrupt that could occur (org 0x04 ; retfie), and made sure that the compiler was set to the "a" version chip and it worked great. I don't know why the simple code was causing an interrupt on the new chip though.

Jan

Reply to
jan

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.