;============================================================================ ; PROJECT : PIC'SPECTRUM ; ; FILE : TESTSIG.INC ; ; VERSION : 1.0 ; ; DESCRIPTION : ; ; Test signals generation (for validation of the FFT routines) ; ; A square test signal is generated during ram initialization, and is ; displayed if the Pic'Spectrum is switched on in hold mode. ; ;============================================================================ ; Developped & Copyrighted by Robert LACOSTE ;============================================================================ ;---------------------------------------------------------------------------- ; test_square : Generate a square signal ; ; On input, amplitude is in math register A, half-period in WREG ;---------------------------------------------------------------------------- test_square clrf cpti,F ; cpti=index to data clrf cptj,F ; cptj=phase movwf test_halfp ; test_halfp=halfperiod testsquare_b incf cptj,F ; increment phase movfp cptj,WREG cpfseq test_halfp ; equal to half-period ? goto testsquare_norm clrf cptj,F ; if yes, reset phase m_mvab m_ldaconst H'E000' ; and multiply phase by -1 call m_mult testsquare_norm m_stai cpti ; store current amplitude incfsz cpti,F goto testsquare_b ; and loop return ;---------------------------------------------------------------------------- ; test_triangle : Generate a triangle signal ; ; On input, step is in math register A, half-period in WREG ;---------------------------------------------------------------------------- test_triangle clrf cpti,F ; cpti=index to data movwf test_halfp ; halfp=halfperiod bcf ALUSTA,C rrcf WREG,W movwf cptj ; cptj=phase (initialised to 50%) m_sta test_step ; test_step=step m_ldaconst 0 m_sta test_cval ; test_cval=current value testtriangle_b incf cptj,F ; increment phase movfp cptj,WREG cpfseq test_halfp ; equal to half-period ? goto testtriang_norm clrf cptj,F ; if yes, reset phase m_lda test_step m_mvab m_ldaconst H'E000' ; and multiply step by -1 call m_mult m_sta test_step testtriang_norm m_lda test_cval ; increment value by step value m_mvab m_lda test_step m_add m_sta test_cval m_stai cpti ; store current amplitude incfsz cpti,F goto testtriangle_b ; and loop return ;============================================================================ ; - END OF FILE - ;============================================================================