ROUTINES= routines-led
LIBS= routines.lib
-INCLUDES= common.inc pindata.inc
+INCLUDES= common.inc pindata.inc ../iwjpictest/clockvaries.inc
include manypics.make
; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: high H = green, low L = red, float Z = black
include /usr/share/gputils/header/p18f458.inc
+ include ../iwjpictest/clockvaries.inc
code
start
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
bsf RCSTA,7,0 ; serial port enable (p182)
+ bsc_txsta_brgh ; set high or low baud rate
-; set SPBRG to get correct baud rate according to table top right p186
-; (Tosc = 20MHz, desired baud rate = 9600)
-
- bsf SPBRG,7,0
- bsf SPBRG,0,0
-
+; set SPBRG to get correct baud rate
+ movlw_movwf_spbrg
; set pin 24 to low (transmission allowed from computer)
include common.inc
include morse-auto.inc
include ../iwjpictest/insn-aliases.inc
+ include ../iwjpictest/clockvaries.inc
extern led_green
extern led_red
; re-initialise timer0 config
bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode
bcf T0CON,5,0 ; timer0 use internal clock
- bcf T0CON,3,0 ; use prescaler
- bcf T0CON,2,0 ; }
- bsf T0CON,1,0 ; } prescale value 1:16 (13ms x 16)
- bsf T0CON,0,0 ; }
+ bsc_morse_t0con_012 ; use prescaler? and configure it
; get # bytes of morse msg, # registers in panic readout, message start addr.
; back from condensed message start addr. stored in PANIC_ADDRESS
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
+ bsc_txsta_brgh ; set high or low baud rate
; initial config - RCSTA register p182
bsf RCSTA,7,0 ; serial port enable (p182)
bcf RCSTA,6,0 ; 8-bit reception
bsf RCSTA,4,0 ; enable continuous receive
-; set SPBRG to get correct baud rate according to table top right p186
-; (Tosc = 20MHz, desired baud rate = 9600)
- bsf SPBRG,7,0
- bsf SPBRG,0,0
+; set SPBRG to get correct baud rate
+ movlw_movwf_spbrg
; interrupt set-up for serial receive
bcf IPR1,5,0 ; set to low-priority interrupt
movwf SSPCON1,0 ; CKP unused, set to 0; master mode.
; set baud rate
- movlw 100-1
- movwf SSPADD,0 ; set baud rate; clock=Fosc/(4*(SSPADD+1))
- ; Fosc=20MHz, currently want clock=50kHz
- ; => SSPADD=99
-
+ movlw i2c_sspadd
+ movwf SSPADD,0
goto i2c_setup_endif_master_slave
i2c_setup_if_slave
; boilerplate:
include /usr/share/gputils/header/p18f458.inc
+ include ../iwjpictest/clockvaries.inc
radix dec
extern led_green
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
+ bsc_txsta_brgh ; set high or low baud rate
; initial config - RCSTA register p182
bsf RCSTA,7,0 ; serial port enable (p182)
bcf RCSTA,6,0 ; 8-bit reception
bsf RCSTA,4,0 ; enable continuous receive
-; set SPBRG to get correct baud rate according to table top right p186
-; (Tosc = 20MHz, desired baud rate = 9600)
- bsf SPBRG,7,0
- bsf SPBRG,0,0
+; set SPBRG to get correct baud rate
+ movlw_movwf_spbrg
; interrupt set-up for serial receive
bcf IPR1,5,0 ; set to low-priority interrupt
movwf SSPCON1,0 ; CKP unused, set to 0; master mode.
; set baud rate
- movlw 100-1
- movwf SSPADD,0 ; set baud rate; clock=Fosc/(4*(SSPADD+1))
- ; Fosc=20MHz, currently want clock=50kHz
- ; => SSPADD=99
-
+ movlw i2c_sspadd
+ movwf SSPADD,0
goto i2c_setup_endif_master_slave
i2c_setup_if_slave
; re-initialise timer0 config
bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode
bcf T0CON,5,0 ; timer0 use internal clock
- bcf T0CON,3,0 ; use prescaler
- bsf T0CON,2,0 ; }
- bcf T0CON,1,0 ; } prescale value 1:32 (13ms x 32)
- bcf T0CON,0,0 ; }
+ bsc_morse_t0con_012 ; use prescaler? and configure it
;
; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: high H = green, low L = red, float Z = black
include /usr/share/gputils/header/p18f458.inc
+ include ../iwjpictest/clockvaries.inc
code
start
; timer initial config
bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode
bcf T0CON,5,0 ; timer0 use internal clock
- bcf T0CON,3,0 ; use prescaler
- bsf T0CON,2,0 ; }
- bcf T0CON,1,0 ; } prescale value 1:32 (13ms x 32)
- bcf T0CON,0,0 ; }
+ bsc_morse_t0con_012 ; use prescaler? and configure it
; actually do stuff
call green
call waiting
include common.inc
include morse-auto.inc
include ../iwjpictest/insn-aliases.inc
+ include ../iwjpictest/clockvaries.inc
extern led_green
extern led_red
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
+ bsc_txsta_brgh ; set high or low baud rate
; initial config - RCSTA register p182
bsf RCSTA,7,0 ; serial port enable (p182)
bcf RCSTA,6,0 ; 8-bit reception
bsf RCSTA,4,0 ; enable continuous receive
-; set SPBRG to get correct baud rate according to table top right p186
-; (Tosc = 20MHz, desired baud rate = 9600)
- bsf SPBRG,7,0
- bsf SPBRG,0,0
+; set SPBRG to get correct baud rate
+ movlw_movwf_spbrg
; interrupt set-up for serial receive
bcf IPR1,5,0 ; set to low-priority interrupt
; re-initialise timer0 config
bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode
bcf T0CON,5,0 ; timer0 use internal clock
- bcf T0CON,3,0 ; use prescaler
- bcf T0CON,2,0 ; }
- bsf T0CON,1,0 ; } prescale value 1:16 (13ms x 16)
- bsf T0CON,0,0 ; }
+ bsc_morse_t0con_012 ; use prescaler? and configure it
; get # bytes of morse msg, # registers in panic readout, message start addr.
; back from condensed message start addr. stored in PANIC_ADDRESS
include /usr/share/gputils/header/p18f458.inc
+ include ../iwjpictest/clockvaries.inc
NMRACTRL equ 0x4 ; byte 4: state relevant to NMRA control
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
+ bsc_txsta_brgh
; initial config - RCSTA register p182
bsf RCSTA,7,0 ; serial port enable (p182)
; set SPBRG to get correct baud rate according to table top right p186
; (Tosc = 20MHz, desired baud rate = 9600)
- bsf SPBRG,7,0
- bsf SPBRG,0,0
+ movlw serial_spbrg
+ movwf SPBRG,0
debug 0x0A ; LF to terminak
; 10 10 10 00 | 1110 1110 | 1110 00 10 | 10 10
include common.inc
+ include ../iwjpictest/clockvaries.inc
extern led_green
extern led_red
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
+ bsc_txsta_brgh ; set high or low baud rate
; initial config - RCSTA register p182
bsf RCSTA,7,0 ; serial port enable (p182)
bcf RCSTA,6,0 ; 8-bit reception
bsf RCSTA,4,0 ; enable continuous receive
-; set SPBRG to get correct baud rate according to table top right p186
-; (Tosc = 20MHz, desired baud rate = 9600)
- bsf SPBRG,7,0
- bsf SPBRG,0,0
+; set SPBRG to get correct baud rate
+ movlw_movwf_spbrg
; interrupt set-up for serial receive
bcf IPR1,5,0 ; set to low-priority interrupt
; re-initialise timer0 config
bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode
bcf T0CON,5,0 ; timer0 use internal clock
- bcf T0CON,3,0 ; use prescaler
- bsf T0CON,2,0 ; }
- bcf T0CON,1,0 ; } prescale value 1:32 (13ms x 32)
- bcf T0CON,0,0 ; }
+ bsc_morse_t0con_012 ; use prescaler? and configure it
clrf BLANK,0
panic_loop
; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: high H = green, low L = red, float Z = black
include /usr/share/gputils/header/p18f458.inc
+ include ../iwjpictest/clockvaries.inc
extern led_green
extern led_red
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
+ bsc_txsta_brgh ; set high or low baud rate
; initial config - RCSTA register p182
bsf RCSTA,7,0 ; serial port enable (p182)
bsf RCSTA,6,0 ; 8-bit reception
bsf RCSTA,4,0 ; enable continuous receive
-; set SPBRG to get correct baud rate according to table top right p186
-; (Tosc = 20MHz, desired baud rate = 9600)
- bsf SPBRG,7,0
- bsf SPBRG,0,0
+; set SPBRG to get correct baud rate
+ movlw_movwf_spbrg
; interrupt set-up for serial receive
bsf PIE1,5,0 ; enable USART receive interrupt (p85)
bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode
bcf T0CON,5,0 ; timer0 use internal clock
bcf INTCON,5,0 ; clear TMR0IE => mask interrupt
- bcf T0CON,3,0 ; use prescaler
- bcf T0CON,2,0 ; }
- bsf T0CON,1,0 ; } prescale value 1:8 (13ms x 8)
- bcf T0CON,0,0 ; }
-
+ bsc_morse_t0con_012 ; use prescaler? and configure it
main
call led_green
; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: high H = green, low L = red, float Z = black
include /usr/share/gputils/header/p18f458.inc
+ include ../iwjpictest/clockvaries.inc
code
start
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
+ bsc_txsta_brgh ; set high or low baud rate
bsf RCSTA,7,0 ; serial port enable (p182)
-; set SPBRG to get correct baud rate according to table top right p186
-; (Tosc = 20MHz, desired baud rate = 9600)
-
- bsf SPBRG,7,0
- bsf SPBRG,0,0
+; set SPBRG to get correct baud rate
+ movlw_movwf_spbrg
call initialiseascii
include /usr/share/gputils/header/p18f458.inc
+ include ../iwjpictest/clockvaries.inc
extern led_green
extern led_red
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
+ bsc_txsta_brgh ; set high or low baud rate
; initial config - RCSTA register p182
bsf RCSTA,7,0 ; serial port enable (p182)
bcf RCSTA,6,0 ; 8-bit reception
bsf RCSTA,4,0 ; enable continuous receive
-; set SPBRG to get correct baud rate according to table top right p186
-; (Tosc = 20MHz, desired baud rate = 9600)
- bsf SPBRG,7,0
- bsf SPBRG,0,0
+; set SPBRG to get correct baud rate
+ movlw_movwf_spbrg
; interrupt set-up for serial receive
include panic.inc
include morse+auto.inc
include ../iwjpictest/insn-aliases.inc
+ include ../iwjpictest/clockvaries.inc
;****************************************************************************
; MACROS
include /usr/share/gputils/header/p18f458.inc
radix dec
include ../iwjpictest/insn-aliases.inc
+ include ../iwjpictest/clockvaries.inc
include panic.inc
include morse+auto.inc
;----------
i2cm_init
- mov_lw 100-1 ; baud rate = Fosc/(4*(SSPADD+1))
- mov_wf SSPADD ; Fosc=20MHz, so SSPADD==99 means 50kbit/s
+ mov_lw i2c_sspadd
+ mov_wf SSPADD
clr_f st
mov_lw 0x08 ; !SSPEN, Master mode
mov_wf SSPCON1
include /usr/share/gputils/header/p18f458.inc
+ include ../iwjpictest/clockvaries.inc
NMRACTRL equ 0x4 ; byte 4: state relevant to NMRA control
bcf TXSTA,6,0 ; p181, set 8-bit mode
bsf TXSTA,5,0 ; transmit enable
bcf TXSTA,4,0 ; asynchronous mode
- bsf TXSTA,2,0 ; set high baud rate
+ bsc_txsta_brgh
; initial config - RCSTA register p182
bsf RCSTA,7,0 ; serial port enable (p182)
; set SPBRG to get correct baud rate according to table top right p186
; (Tosc = 20MHz, desired baud rate = 9600)
- bsf SPBRG,7,0
- bsf SPBRG,0,0
+ movlw serial_spbrg
+ movwf SPBRG,0
debug 0x0A ; LF to terminak
clr_f STKPTR ; avoids stack overruns
; re-initialise timer0 config
- mov_lw (1<<TMR0ON) | 011b ; Enable, 16-bit, timer, prescaler 1:16
- mov_wf T0CON ; => PSout is 312.5kHz or 3.2us per period (DS p108)
- ; We want to wait 66ms (morse at 18wpm according to the PARIS standard
- ; is a unit time of 66ms), or 20,833 PSout cycles:
-waiting_t0cycles equ 20833 ; see by `waiting', below
+ mov_lw (1<<TMR0ON) | morse_t0scale ; Enable, 16-bit, timer, prescaler
+ mov_wf T0CON
; get # bytes of morse msg, # registers in panic readout, message start addr.
; back from condensed message start addr. stored in panic_address
; waits for a fixed interval, depending on the configuration of TMR0
bc_f INTCON,2 ; clear timer0 interrupt bit (p109)
-; Interrupt happens on overflow. So start at 65535-waiting_t0cycles:
- mov_lw (65535-waiting_t0cycles) / 256
+; Interrupt happens on overflow. So start at 65535-morse_t0cycles:
+ mov_lw (65535-morse_t0cycles) / 256
mov_wf TMR0H ; p107 set high byte of timer0 (buffered,
; only actually set when write to tmr0l occurs)
- mov_lw (65535-waiting_t0cycles) & 0xff
+ mov_lw (65535-morse_t0cycles) & 0xff
mov_wf TMR0L ; set timer0 low byte - timer now set
waiting_loop
bt_f_if0 INTCON,TMR0IF
delay_countfast res 1
delay_countmedium res 1
delay_countslow res 1
-delay_slowexp equ 2 ; 2^2 * 40ms = 160ms
code
return
;======================================================================
-; delay routine, nicked from flasher.asm
-
-delay
- ; set a bit which says how fast the led
- ; should flash and count down from 2^(that bit)
- bsf delay_countslow, delay_slowexp, 0
-delayslow_loop
-
-delaymedium_loop
-
-delayfast_loop
- decfsz delay_countfast, 1, 0 ; 1 cycle
- goto delayfast_loop ; 2 cycles (skipped or not)
-; exited delayfast_loop ; total: 3 * 256 = 768 cycles
-
-
- decfsz delay_countmedium, 1, 0 ; 1 cycle
- goto delaymedium_loop ; 2 cycles (skipped or not)
-; exited delaymedium_loop ; total: ~198000 cycles
-
- ; each cycle 0.2us
- ; so each medium loop is ~40ms
-
- decfsz delay_countslow, 1, 0
- goto delayslow_loop
-; exited delayslow_loop
-
- return
+ define_busywait_delay ; from iwjpictest/clockvaries.inc
;======================================================================
; SERIAL LIBRARY
;----------------------------------------
serial_setup
; W undefined undefined
- mov_lw (1<<TXEN) | (1<<BRGH) | (1<<TRMT)
- mov_wf TXSTA ; asynch xmit enabled, high baud rate, 8-bit,
- mov_lw 129
- mov_wf SPBRG ; 9600bps (with BRGH)
+ mov_lw (1<<TXEN) | serial_brgh | (1<<TRMT)
+ mov_wf TXSTA ; asynch xmit enabled, high baud rate?, 8-bit,
+ mov_lw serial_spbrg
+ mov_wf SPBRG
serial_receive_reset ;from serial_read_if_error
mov_lw (1<<SPEN) | (1<<CREN)
mov_wf RCSTA ; enable serial port, continuous rx, 8-bit
PROGRAMS= flasher copybits serialloop harness
-INCLUDES= insn-aliases.inc onecopybit.inc test.inc
+INCLUDES= insn-aliases.inc onecopybit.inc test.inc clockvaries.inc
include ../common.make
--- /dev/null
+;----------------------------------------------------------------------
+; various definitions for clock variation
+
+ radix dec
+
+;----------------------------------------------------------------------
+; for serial port at 9600
+; according to table in datasheet top right p186
+
+ if mclock==20000
+serial_brgh equ (1<<BRGH)
+serial_spbrg equ 129
+ endif
+ if mclock==1000
+ endif
+
+bsc_txsta_brgh macro
+ if serial_brgh
+ bsf TXSTA,2,0 ; set high baud rate
+ else
+ bcf TXSTA,2,0 ; set low baud rate
+ endif
+ endm
+
+movlw_movwf_spbrg macro
+ movlw serial_spbrg
+ movwf SPBRG,0
+ endm
+
+;----------------------------------------------------------------------
+; for i2c at 50kbit/s
+
+; baud rate = Fosc/(4*(SSPADD+1))
+ if mclock==20000
+i2c_sspadd equ 100-1 ; Fosc=20MHz, so SSPADD==99 means 50kbit/s
+ endif
+ if mclock==1000
+ endif
+
+;----------------------------------------------------------------------
+; NMRA at 50us per division
+; ... uh, this isn't going to work at 1MHz because that's only 12.5
+; insns per NMRA division
+
+;----------------------------------------------------------------------
+; for morse at 18wpm according to the PARIS standard
+; (ie a unit time of 66ms) using timer0 (DS p108)
+
+ if mclock==20000
+morse_t0scale equ 0011b ; 1:16 => PSout is 312.5kHz or 3.2us per period
+morse_t0cycles equ 20833 ; see by `waiting', below
+ endif
+ if mclock==1000
+;morse_t0scale equ 0011b ; 1:2 => PSout is 312.5kHz or 3.2us per period
+;morse_t0cycles equ 0
+ endif
+
+bsc_morse_t0con_012 macro
+ movf T0CON,0,0
+ andlw 0xf0
+ iorlw morse_t0scale
+ movwf T0CON,0
+ endm
+
+;----------------------------------------------------------------------
+; busy-wait delay loop, originally from flasher.asm
+
+ if mclock==20000 ; each cycle 0.2us
+delay_fastloop equ 1 ; each medium loop = ~40ms
+delay_slowexp equ 2 ; 2^2 * 40ms = 160ms
+ endif
+ if mclock==1000 ; each cycle 4us
+delay_fastloop equ 0 ; each medium loop = ~3ms
+delay_slowexp equ 6 ; 2^6 * 3ms = 192ms
+ endif
+
+define_busywait_delay macro
+delay
+
+; we always leave each loop when its counter has reached 0, so on
+; entry we assume it's already 0. For the loops which want to
+; count all the way (256 iterations) that's good.
+
+ ; set a bit which says how fast the led
+ ; should flash and count down from 2^(that bit)
+ bsf delay_countslow, delay_slowexp, 0
+delayslow_loop
+
+delaymedium_loop
+
+ if delay_fastloop
+delayfast_loop
+ decfsz delay_countfast, 1, 0 ; 1 cycle
+ goto delayfast_loop ; 2 cycles (skipped or not)
+; exited delayfast_loop ; total: 3 * 256 = 768 cycles
+ endif
+
+
+ decfsz delay_countmedium, 1, 0 ; 1 cycle
+ goto delaymedium_loop ; 2 cycles (skipped or not)
+; exited delaymedium_loop ; total: ~198000 cycles
+ ; or ~768 cycles (no fast)
+
+ decfsz delay_countslow, 1, 0
+ goto delayslow_loop
+; exited delayslow_loop
+
+ return
+
+ endm
include /usr/share/gputils/header/p18f458.inc
include onecopybit.inc
+ radix dec
+
ACCSFR equ 0x0f00
COUNTINNER equ 0x00
COUNTOUTER equ 0x02
+ if mclock==20000
OUTEREXP equ 7 ; 2^7 * 2.6ms = 332ms
+ endif
+ if mclock==1000
+OUTEREXP equ 2 ; 2^2 * 52ms = 208ms
+ endif
; we always leave each loop when its counter has reached 0, so on
; entry we assume it's already 0. For the loops which want to
; * leaves all other pins set to their default states (usually Z).
include /usr/share/gputils/header/p18f458.inc
+ radix dec
-COUNTFAST equ 0x00
-COUNTMEDIUM equ 0x01
-COUNTSLOW equ 0x02
-
-SLOWEXP equ 2 ; 2^2 * 40ms = 160ms
-
-; we always leave each loop when its counter has reached 0, so on
-; entry we assume it's already 0. For the loops which want to
-; count all the way (256 iterations) that's good.
+delay_countfast equ 0x00
+delay_countmedium equ 0x01
+delay_countslow equ 0x02
+ include clockvaries.inc
code
start
call delay
goto delay
-delay
- ; set a bit which says how fast the led
- ; should flash and count down from 2^(that bit)
- bsf COUNTSLOW, SLOWEXP, 0
-delayslow_loop
-
-delaymedium_loop
-
-delayfast_loop
- decfsz COUNTFAST, 1, 0 ; 1 cycle
- goto delayfast_loop ; 2 cycles (skipped or not)
-; exited delayfast_loop ; total: 3 * 256 = 768 cycles
-
-
- decfsz COUNTMEDIUM, 1, 0 ; 1 cycle
- goto delaymedium_loop ; 2 cycles (skipped or not)
-; exited delaymedium_loop ; total: ~198000 cycles
-
- ; each cycle 0.2us
- ; so each medium loop is ~40ms
-
- decfsz COUNTSLOW, 1, 0
- goto delayslow_loop
-; exited delayslow_loop
-
- return
+ define_busywait_delay
end
nolist
include /usr/share/gputils/header/p18f458.inc
include insn-aliases.inc
+ include clockvaries.inc
; list
radix dec
;----------------------------------------
serial_setup
; W undefined undefined
- mov_lw (1<<TXEN) | (1<<BRGH) | (1<<TRMT)
+ mov_lw (1<<TXEN) | serial_brgh | (1<<TRMT)
mov_wf TXSTA ; asynch xmit enabled, high baud rate, 8-bit,
- mov_lw 129
+ mov_lw serial_spbrg
mov_wf SPBRG ; 9600bps (with BRGH)
serial_receive_reset ;from serial_read_if_error
mov_lw (1<<SPEN) | (1<<CREN)
; as shown in diagram SERIAL LOOP TEST
;
include /usr/share/gputils/header/p18f458.inc
+ radix dec
include onecopybit.inc
COUNTINNER equ 0x00
COUNTOUTER equ 0x02
+ if mclock==20000
OUTEREXP equ 7 ; 2^7 * 1.4ms = 177ms
+ endif
+ if mclock==1000
+OUTEREXP equ 3 ; 2^3 * 28ms = 224ms
+ endif
; we always leave each loop when its counter has reached 0, so on
; entry we assume it's already 0. For the loops which want to
# FOO-entire0.hex FOO.o idlocs0.o config.o
# perpicNUMBER.hex idlocsNUMBER.o config.o
+#ASFLAGS= -Dmclock=20000d -Dsclock=20000d
+ASFLAGS= -Dmclock=1000 -Dsclock=1000
+
LINK= gplink -m -o $@ $^
-ASSEMBLE= gpasm -p 18f458
+ASSEMBLE= gpasm -p 18f458 $(ASFLAGS)
%.o: %.asm $(INCLUDES)
$(ASSEMBLE) -c $<