Did some digging in the specification. I am still learning how to understan= d the datasheet so I can be reading it wrong so here is what I found: Jan-Erik: I tried to find the information in the datasheet (yes I found the datasheet= :-) . I also set to US-ASCII hope its better now thanks for that info. N= ow TRISA seems to be what is in the data sheet but OPTION_REG seems to be= what is used in the datasheet not OPTION. I assembled the program with = OPTION_REG and I get a warning since apparently the p16f876.inc supplied = with MPLAB does not have this referenced in it but it does have the OPTIO= N referenced and that is a clean build. I tried both builds anyway and ne= ither seem to work. Now as you justly put it how do I know its not workin= g. What I mean is that after flashing the 16f876 with the hex file the LE= D's do nothing. I then do a POR and still nothing. You stated "Make sure that interrupts are disabled by clearing the GIE flag= . Proaby not the problem here either, but anyway..." I did not do this ye= t as I am not up to the level of such things yet. I am still learning by = getting somethiong done by someone else running first and go from there. = This is the first assembly project I tried my others were with the JAL pr= ogram. Alex:=20 On p149 the specification states for DC operation that any I/O pin can sour= ce or sink 25mA and the maximum total current is 200 mA all ports. The ci= rcuit has only 4 LED's each with a 330 ohm resistor in series (15 mA per = LED if I got that right) so it appears like I should be OK. I just want t= o check to see if I am OK so I don't damage my 16F876 !!! With a differen= t program the LED flashes fine on RB0. ANY other help appreciated -----Original Message----- From: Jan-Erik Soderholm To: PICLIST@MITVMA.MIT.EDU Date: Mon, 8 Mar 2004 17:08:05 +0100 Subject: Re: [PIC:] Newbie trying to assemble using MPASM for 16f876 Richard S wrote : > Here is my program as I have it now can anyone see a reason > this should not work. First one thing... Try to set you mail tool so it sends "plain text/US-ASCII". You used "plain= text/UTF-8", which (at least in my tool) gives vaiable character spacing and hard to read code. Next, try to keep each lin= e not longer then aprox 66 characters (or at least as short as possible) = to avoid split lines. Now, look up the instructions TRIS and OPTION in your data sheet (if you can find them at all (the intructions ! Not the data sheets :-) :-) )). They are both "depricated" and should not be used on newer PICs. Probably not the problem here, but why take the risk :-) Make sure that interrupts are disabled by clearing the GIE flag. Proaby not the problem here either, but anyway... And finaly, how do you *know* that the program doesn't work ? What happens if anything happens at all ? Good luck ! Jan-Erik. > > Again appreciate the help > > ;------------------------------------------------------------- > ----------; > ; 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 it over. > ERRORLEVEL -224 ; supress annoying message > because of tris > __CONFIG _PWRTE_ON & _LP_OSC & _WDT_OFF ; > configuration switches > > ORG 0 ; start a 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 > ; > ;------------------------------------------------------------- > ----------; > movlw B'00000000' ; all bits low in W > tris PORTA ; contents of W copied to PORT A ... > tris PORTB ; and PORT B > tris PORTC ; and PORT C > movlw B'00000100' ; pull-ups active > ; prescalar assigned to TMR0 > and set 1:32 > option ; rolls over each second > > ;------------------------------------------------------------- > ----------; > ; This is the main program > ; > ;------------------------------------------------------------- > ----------; > clrf PORTB ; start with zero > loop: > incf PORTB, f ; add 1 to port B > btfss INTCON, T0IF ; wait on T0IF to be set > goto $ -1 > bcf INTCON, T0IF ; clear the interrupt flag > goto loop > > end ; end of program > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics