by Steve Anderson » Wed Sep 12, 2018 5:43 pm
Interesting program, but in Basic...no thanks...though DOSBox may well run it if converted to Qbasic.
But how I wish people commented their code, here's a small chunk of mine for the SSTV-625 up-converter...
Anything that starts with a ';' is just text and all after ignored as far as the processor/assembler is concerned. (A REM in BASIC).
;**************** SSTV Main Program *******************
SSTVinit
movlw B'00000001' ; Set up ADC, left justified, no Tacq, A/D clock 1us.
movwf ADCON2 ; ANSELA and TRISA already set up in Init routine.
movlw B'00000001' ; Input AN0 (video input), ADC ON.
movwf ADCON0 ; ADCON1 at reset values.
; movlw 0xF7 ; Calculated values for 4151Hz interrupt (US rate). Temp. (Nom. 0xF784 T0 value).
; movwf SampH
; movlw 0x84
; movwf SampL
movlw 0xF9 ; Calculated values for 4654Hz interrupt (EU rate). Temp. (Nom. 0xF949 T0 value).
movwf SampH
movlw 0x49
movwf SampL
movlw 0x7F ; Initial sync-level value. Sync x4 stage = 1.2V, half = 0.6V, Ref = 5V, at 8-bits, 0.12 = 30.6, say 31.
movwf SyncL ;
movlw B'10001000' ; Set up TMR0, ON, 16-bit mode, internal clock at 8MHz, no pre-scaler.
movwf T0CON
movff SampH,TMR0H ; Load TMR0.
movff SampL,TMR0L ;
movlw B'10100000' ; Enable T0 interrupts, clear any others.
movwf INTCON
SSTVloop
bra SSTVloop ; Endless loop awaiting interrupt from TMR0.
-----------------------------
It simply makes things easier, especially if the author (me) has to return to the code in the future.
The above is just a very small chunk of code used as an example, it's useless as it is.
Steve A.
Note: Code is for PIC18 devices, you won't find some instructions available for PIC12/16 devices, e.g. movff