Windows 7, 32
SimulIDE-R1861_Win32
To fix bugs in the code ‘EarTest_08P_.asm’ (attached), adding and/or removing a breakpoint likely leads to freezing or crashing the program.
I noticed that, for a breakpoint to be stable, its asm file should be saved. But this doesn’t help while debugging a complex code when breakpoints may need to be added or removed while the debugger session is running.
I am afraid that since you don’t have a clear idea of the attached code, you may not reproduce this.
For the time being, the code is supposed to synthesis a sinewave by generating/saving a delta bit-stream table (bits are saved as bytes in SRAM, DLT_tbl: at 0x06B8, 25 bytes for 2 cycles). The delta bits are outputted at PB7 (DOwavHi:). The delta bit clock is 2 MHz (4 cycles*0.125us).
After outputting 24 cycles of sinewave, the code loop is interrupted by timer 1. The timer 1 interrupt routine decreases the ‘delta step’ (dvFd_H: dvFd_L) then another 24 cycles of sinewave are generated (for the same N bits per cycle, which is 97 bits here, 20.62 kHz, though a bug lets it be 20.41 kHz!).
By decreasing the ‘delta step’, the generated sinewave amplitude increases. The code will be interrupted by INT0 when the amplitude reaches certain amplitude (3.37 V here) in order to start a new frequency (a lower one) by incrementing N bits (97 to 98 here).
At the end of the project, the total number of frequencies will be 485 to produce 20.83 kHz down to 0.648 kHz. And by reducing the delta bit rate 32 times (2,000,000 to 62,500 Hz), the generated frequencies become from 651 Hz down to 20 Hz.
Now, I am stuck to find out the bug that lets the frequency be 20.41 kHz instead of 20.62 kHz (as if the delta N bits per cycle is 98 instead of 97).

SimulIDE-R1861_Win32
To fix bugs in the code ‘EarTest_08P_.asm’ (attached), adding and/or removing a breakpoint likely leads to freezing or crashing the program.
I noticed that, for a breakpoint to be stable, its asm file should be saved. But this doesn’t help while debugging a complex code when breakpoints may need to be added or removed while the debugger session is running.
I am afraid that since you don’t have a clear idea of the attached code, you may not reproduce this.
For the time being, the code is supposed to synthesis a sinewave by generating/saving a delta bit-stream table (bits are saved as bytes in SRAM, DLT_tbl: at 0x06B8, 25 bytes for 2 cycles). The delta bits are outputted at PB7 (DOwavHi:). The delta bit clock is 2 MHz (4 cycles*0.125us).
After outputting 24 cycles of sinewave, the code loop is interrupted by timer 1. The timer 1 interrupt routine decreases the ‘delta step’ (dvFd_H: dvFd_L) then another 24 cycles of sinewave are generated (for the same N bits per cycle, which is 97 bits here, 20.62 kHz, though a bug lets it be 20.41 kHz!).
By decreasing the ‘delta step’, the generated sinewave amplitude increases. The code will be interrupted by INT0 when the amplitude reaches certain amplitude (3.37 V here) in order to start a new frequency (a lower one) by incrementing N bits (97 to 98 here).
At the end of the project, the total number of frequencies will be 485 to produce 20.83 kHz down to 0.648 kHz. And by reducing the delta bit rate 32 times (2,000,000 to 62,500 Hz), the generated frequencies become from 651 Hz down to 20 Hz.
Now, I am stuck to find out the bug that lets the frequency be 20.41 kHz instead of 20.62 kHz (as if the delta N bits per cycle is 98 instead of 97).

- Attachments
EarTest_08P_.zip
- You don't have permission to download attachments.
- (31 Kb) Downloaded 1 times
EarTest_08P_lst.zip
- You don't have permission to download attachments.
- (43 Kb) Downloaded 1 times