Note to yourself, even though in this case it doesn't matter (because the default OSC is 4), the DEFINE's MUST be in CAPS, either the DEFINE itself, or the parameters, I don't remember which. In my case, I always just put both in caps. Don't have to figure out which one then.
Code:
DEFINE OSC 4
DEFINE LCD_DREG PORTD 'LCD addressing
DEFINE LCD_DBIT 4 'L1 = $80
DEFINE LCD_RSREG PORTD 'L2 = $C0
DEFINE LCD_RSBIT 1 'L3 = $94
DEFINE LCD_EREG PORTD 'L4 = $D4
DEFINE LCD_EBIT 3
DEFINE SHIFTPAUSE_US 16
include "modedefs.bas"
lcdrw var portd.2:nsel var portb.4:sdi var portb.5:sck var portb.6:sdo var portb.7
dout var word:trisb=4:lcdrw=0:nsel=1:sdi=1:sck=0:pause 500:lcdout $fe,1
Start:
lcdout $fe,$80,"RFM12B Initialize":pause 500:gosub Init:goto start
WriteCMD:
nsel = 0 : shiftout sdi , sck , 5 , dout\16 : nsel = 1 : return
Init:
for temp = 0 to 12
lookup temp , [ $80D8 , $8208 , $A640 , $C647 , $94C0 , $C2AC , $CA80 , $CA83 , $C49B , $9850 , $E000 , $C80E , $C0F7 ] , dout
gosub writecmd
next temp
Return
This should do exactly the same thing, but uses the shiftout command. Assuming your original program worked as you wanted it to work....
Bookmarks