I REALLY APPRECIATE (now I will lower my voice) the help and you all sticki= ng with me I am sure you sensed my frustration and lack of knowledge. I n= ow have two programs working written differently that do the same thing t= hat should get me going faster that I hoped. The support here is nothing = short of outstanding. Right on about the "CASE sensitivity" I thought only Linux was case sensiti= ve. Question: thinking ahead what is the risk of being case insensitive I= much prefer it. Now I think I am ready to tacvkle the 200+ page datasheet and begin to unde= rstand in depth what these two programs are doing and how everything ties= together. I still don't know what limits the counter to count binary 000 to 111 and t= hen restart at 000 does not continuously count up. That hopefully will be= something I can figure out as I study what I have.=20 I think one I understand the following build log and how to fix it I am rea= dy to tackle the datasheet and modify the code on my own and see what hap= pens. Code now looks like this (the Jinx one) but I get basically the same error = with my other version. what do these unfatal failures mean I can't seem t= o find a sourse of information so I can understand for myself. Build Log: Deleting intermediary files... done. Executing: "C:\Program Files\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p16F87= 6 "Binarycounter_876_V2.asm" /l"Binarycounter_876_V2.lst" /e"Binarycounte= r_876_V2.err" /c- Message[302] C:\16F876 PROJECTS\BINARYCOUNTER_876_V2.ASM 24 : Register in o= perand not in bank 0. Ensure that bank bits are correct. Message[302] C:\16F876 PROJECTS\BINARYCOUNTER_876_V2.ASM 25 : Register in o= perand not in bank 0. Ensure that bank bits are correct. Message[302] C:\16F876 PROJECTS\BINARYCOUNTER_876_V2.ASM 36 : Register in o= perand not in bank 0. Ensure that bank bits are correct. Message[302] C:\16F876 PROJECTS\BINARYCOUNTER_876_V2.ASM 42 : Register in o= perand not in bank 0. Ensure that bank bits are correct. Message[305] C:\16F876 PROJECTS\BINARYCOUNTER_876_V2.ASM 49 : Using default= destination of 1 (file). Message[305] C:\16F876 PROJECTS\BINARYCOUNTER_876_V2.ASM 54 : Using default= destination of 1 (file). Loaded C:\16f876 Projects\Binarycounter_876_V2.COD BUILD SUCCEEDED: Tue Mar 09 09:11:43 2004 The source code: ;-----------------------------------------------------------------------; ; BINCNT.ASM Counts in binary on LEDs ( RB0 - RB4 ) ; ;-----------------------------------------------------------------------; ;-----------------------------------------------------------------------; ; The next 6 lines are directions to the assembler ; ;-----------------------------------------------------------------------; LIST P=3D16F876 ; tells which processor is used INCLUDE "p16f876.inc" ; defines various registers etc. Look ERRORLEVEL -224 ; supress annoying message from tris __CONFIG _PWRTE_ON & _HS_OSC & _WDT_OFF ; config. switches CBLOCK H'20' ; set up general registers starting at ; address 32 counter ; a general counting register ENDC ; end of register definitions ORG 0 ; start at program memory location zero ;----------------------------------------------------------------------; ; First we set up all bits of PORT A and B as outputs ; ; and set bits in the OPTION register concerning TMR0 ; ;----------------------------------------------------------------------; =09=09banksel trisa ;switch to bank1 =09clrf trisa ;set A and B as all outputs =09clrf trisb =09movlw b'00000101' =09=09=09; 0 PortB pull-ups enabled =09=09=09; 0 =09=09=09; 0 internal TMR0 source =09=09=09; 0 =09=09=09; 0 pre-scaler -> TMR0 =09=09=09; =09=09=09; 1 101 =3D /64 pre-scaler =09=09=09; 0 =09=09=09; 1 =09movwf option_reg ;You also need to set the analogue/digital status of PortA. This ;can be found in Section 11 of DS30292B (F87x manual) =09movlw b'00000110' ;set to all digital =09movwf adcon1 =09banksel porta ;switch back to bank0 ;----------------------------------------------------------------------; ; This is the main program ; ;----------------------------------------------------------------------; clrf counter again: incf portb ;"f" is default loop: btfss INTCON, T0IF goto $ -1 bcf INTCON, T0IF ; decfsz counter goto loop goto again ;because when decfsz counter is true, counter=3D0 and then you'd ;jumped to a movlw 255 movwf counter, which is extraneous, unless ;you actually wanted to skip a procedure when counter=3D0. Otherwise ;just clear it once and let it repeatedly roll under on its own. In your ;case you don't even really need to initially clear it, but actively cleari= ng ;variables can be a good practice (especially if they pop up in other ;routines and you get unexpected results) end ; end of program Thanks again all :-)) Hope I can start asking inteligent questions soon.!!! -----Original Message----- From: Jinx To: PICLIST@MITVMA.MIT.EDU Date: Wed, 10 Mar 2004 01:12:32 +1300 Subject: Re: [PIC:] Newbie trying to assemble using MPASM for 16f876 > Symbol not previously defined (loop) My apologies. I snipped those three OK "loop" lines out when I was trying to tidy up the others ;---------------------------------------- loop: btfss INTCON, T0IF goto $ -1 bcf INTCON, T0IF ; ;---------------------------------------- -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.