Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I use the exact same assembler as you (MPASM in MPLAB). Same programmer too, I think (PICkit 2 or Junebug?), not that that would make any difference.Thanks, I think it's the compiler, the AD program was fine on yours, yet it didn't register on mine. Now this definitely seem to indicate a problem with either the compiler or the programmer.
000 1683 BSF 0x3, 0x5 9: banksel TRISA
002 3000 MOVLW 0 10: movlw 0x00
003 0085 MOVWF 0x5 11: movwf TRISA
004 1283 BCF 0x3, 0x5 12: banksel PORTA
13:
14: start
006 30FF MOVLW 0xff 15: movlw B'11111111'
007 0085 MOVWF 0x5 16: movwf PORTA
17:
008 200D CALL 0xd 18: call delay
19:
009 3000 MOVLW 0 20: movlw B'00000000'
00A 0085 MOVWF 0x5 21: movwf PORTA
22:
00B 200D CALL 0xd 23: call delay
00C 2806 GOTO 0x6 24: goto start
25:
26: delay
00D 3006 MOVLW 0x6 27: movlw B'00000110'
00E 00A0 MOVWF 0x20 28: movwf count ;set count register
29: loop
00F 0BA0 DECFSZ 0x20, F 30: decfsz count,F ;count 6 tocks
010 280F GOTO 0xf 31: goto loop
011 0008 RETURN 32: return
It's using address $05 in bank 1, which is equal to $85. Normal.When I look at the disassembly, I see that TRISA is given the address 0x05, instead of 0x85. Maybe that's the problem.
What's a registry? Isn't that some stupid Windoze thing?Baby steps are frustrating... and the registry doesn't change either.
Banksel works fine. I use it all the time. Never had any problem with it. It's a macro that does the bsf stuff for you. It's just clearer to read.I used the BSF status,5 command to change banks, and the registers now follow correctly. Seems I can't be using bankselect command.
You understand that the Firefly's LEDs are charlieplexed, right? They won't work properly if you don't understand that part. Look closely at the schematic. RA0, RA6 and RA7 as well as their TRIS bits must be toggled correctly to get the LEDs you want lit up.but the LEDs don't light up.
OK the LEDS are on PortA, so I changed it, and it still doesn't light up.
Unknown. Post your code.And instead of getting 11111111 on PORTA, I get 11010000 ...?
on the toggle, I programmed 11111111, yet the register toggles between 00000000 and 11010000.... how is that?
list p=16F88
include <p16f88.inc>
__config _CONFIG1, _WDT_OFF & _INTRC_IO & _MCLR_ON & _LVP_OFF
cblock 0x20
count
TIMER1
TIMER2
endc
bsf STATUS,5
movlw 0x00
movwf TRISA
bcf STATUS,5
clrw
start
movlw B'11111111'
movwf PORTA
call delay
movlw 0x00
movwf PORTA
call delay
goto start
delay
MOVLW D'2'
MOVWF TIMER1
DELAY2
MOVLW D'2'
MOVWF TIMER2
DECFSZ TIMER2,F
GOTO $-1
DECFSZ TIMER1,F
GOTO DELAY2
RETLW 0
end
Fun, huh?I've been on this all day...
clrf ANSEL
Everybody goes through this stage where everything is confusing. And it always seems like it must be the tools at fault. It isn't. It's you. It really is! MPLAB is remarkably bug free. There are some, but you haven't seen them yet.Baby steps can be very frustrating....
I'm sorry to put you through this...