[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
gpsim register question
From: "Maxim Wexler" ####@####.#### Date: 30 Dec 2006 18:25:24 +0000 Message-Id: <a0811460612301025q71566533jf0622bd569e0f2f1@mail.gmail.com> Hi group, Here's a piece of flasher code: Delay Loop1 decfsz COUNT1,1 COUNT1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: gpsim register question
From: "Maxim Wexler" ####@####.#### Date: 30 Dec 2006 18:27:33 +0000 Message-Id: <a0811460612301027y4b0bf3b0x3b550cc3b6f74581@mail.gmail.com> Oops, mail got sent prematurely On 12/30/06, Maxim Wexler ####@####.#### wrote: > > Hi group, > > Here's a piece of flasher code: > > Delay > Loop1 decfsz COUNT1,1 > > where COUNT1 > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: gpsim register question
From: "Maxim Wexler" ####@####.#### Date: 30 Dec 2006 18:50:24 +0000 Message-Id: <a0811460612301050k7e33dadcpa4aa0a59af19a655@mail.gmail.com> aargh, did it again! Confusing the tab with the caps lock 8( Anyway COUNT1 equ 20h Now when I step through the code and pass the decfsz command 20h in the register viewer fills up with FFh from 00h. Where does that 255 come from? There's no mention anywhere in the previous code. And besides, according to the pdf for DECFZ f,d f can't be more that 127. Here's the code up to the first(of two) delay loops: ;*****Set up the Constants**** STATUS equ 03h ;Address of the STATUS register TRISA equ 85h ;Address of the tristate register for port A PORTA equ 05h ;Address of Port A COUNT1 equ 20h ;First counter for our delay loops COUNT2 equ 21h ;Second counter for our delay loops ;****Set up the port**** bsf STATUS,5 ;Switch to Bank 1 movlw 00h ;Set the Port A pins movwf TRISA ;to output. bcf STATUS,5 ;switch back to Bank 0 movlw 02h ;Set up our w register with 02h ;****Turn the LED on and off**** Start xorwf PORTA,1 ;Toggle the LED ;****Add a delay call Delay ;****Now go back to the start of the program goto Start ;go back to Start and turn LED on again ;****Here is our Subroutine Delay Loop1 decfsz COUNT1,1 ;This second loop keeps the LED goto Loop1 ;turned off long enough for us to <...> Another thing: In the breadboard window only porta0 to porta5 become outputs. 6&7 remain inputs. Why, after being sent all zeros? Maxim | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |