Re: [Flashforth-devel] PIC18F26/46/56Q71
Brought to you by:
oh2aun
From: Tristan W. <ho...@tj...> - 2023-04-14 06:04:57
|
Update #2 TRISx LATx PORTx do not appear to be in the access bank for the PIC18F56Q71 and perhaps PIC18FxxQ71 family. Best wishes, Tristan -tw-led marker -tw-led ( The EV01G21A dev board has an active low LED on RC7 ) $c142 constant latc $c14a constant trisc $c152 constant portc 1 constant b, : banksel, ( a -- ) 8 rshift $f and movlb, ; : s, ( a n -- b, ) over banksel, b, ; : led ( -- ) %10000000 trisc mclr ; \ This will not work on PIC18F56Q71 as TRISx LATx PORTx do not \ appear to be in access bank on this mcu \ : +led ( -- ) [ latc 7 a, bcf, ] ; \ : -led ( -- ) [ latc 7 a, bsf, ] ; \ This will work and is compact : +led ( -- ) [ latc 7 s, bcf, ] ; : -led ( -- ) [ latc 7 s, bsf, ] ; \ This will work and is (perhaps) clearer \ : +led ( -- ) [ latc banksel, latc 7 b, bcf, ] ; \ : -led ( -- ) [ latc banksel, latc 7 b, bsf, ] ; |