this works better the first one did no work for sequential 1's
Code:'**************************************************************** '* Name : MODULATOR.BAS * '* Author : [select VIEW...EDITOR OPTIONS] * '* Notice : Copyright (c) 2016 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 5/29/2016 * '* Version : 1.0 * '* Notes : * '* : 16F1825 * '**************************************************************** #CONFIG __config _CONFIG1, _FOSC_INTOSC & _CP_OFF & _WDTE_ON & _PWRTE_ON & _MCLRE_ON & _CLKOUTEN_OFF __config _CONFIG2, _PLLEN_ON & _LVP_OFF #ENDCONFIG OSCCON=$70 DEFINE OSC 32 ' PIC 16F1825 TRISA = %111111 ' Make all pins Input trisc = %101111 ;Make all pins Input ANSELA=0 ANSELC=0 MDSRC= %00000000 MDCARH =%11000100 MDCARL =%00000000 X VAR byte darta VAR byte[4] TIMER1 VAR WORD EXT clear modout var latc.4 darta.0[14]=1 darta.0[15]=1 hpwm 1,128,1600 MDCON.0 = 0 modout =0 Main_Loop: modout=1 pauseus 8000 modout =0 while tmr2 :wend MDCON= %11010001 for x = 0 to 31 while tmr2 :wend if darta.0[x] then MDCON.0 = 0 while tmr2 :wend pauseus 6 while tmr2 :wend pauseus 6 MDCON.0 = 1 while tmr2 :wend pauseus 6 else MDCON.0 = 1 endif next modout=1 MDCON= 0 pauseus 600 modout = 0 PAUSE 200 goto Main_Loop end




Bookmarks