With the header file mismatch, go into MPLAB, open options/development mode, then set the processor type for editor or sim (whatever you're using) to 16F871, I am sure you will find this is set to something else. Other wise check your p16F871.inc file to see if someone has edited it (never edit them). Good luck. Hardware Engineering wrote: > > I've been working on a project using the 16F871 chip, I got two samples from > Microchip, updated MPLAB to the latest version, and set to get going on this. > > The first thing I always do is something simple, just to let me know that the > chip is working, rather than do something elaborate and try to figure out what > I did wrong. So I did the simple, read a port switch, and turn on an LED when > the switch activates. No go. I used portA for the input, set the TRIS to > 0xFF, and used portC as the output, setting TRIS to 0x00 > > Seems the portC is not behaving as an output. I'm using a 4MHz TTL oscillator > (yes its working, have it hooked to OSC1 input, and get an output on OSC2, > input is set to HS. > > I even backed off and made the program simple by just TURNING on the LED but > portC seems to be...not working or intializing. > > Now, one thing that is strange is I get the following error in MPLAP when I > assemble. > > Building TEST.HEX... > > Compiling TEST.ASM: > Command line: "C:\PROGRA~1\MPLAB\MPASMWIN.EXE /p16F871 /q D:\A_STC\TEST.ASM" > Message[301] D:\A_STC\P16F871.INC 35 : MESSAGE: (Processor-header file > mismatch. Verify selected processor.) > Warning[224] D:\A_STC\TEST.ASM 19 : Use of this instruction is not > recommended. > Warning[224] D:\A_STC\TEST.ASM 22 : Use of this instruction is not > recommended. > > Build completed successfully. > > Whats the deal with the processor header file mismatch? > > here is the source file > > list p=16F871 ; list directive to define processor > #include ; processor specific variable definitions > PORTA EQU H'0005' > PORTB EQU H'0006' > PORTC EQU H'0007' > PORTD EQU H'0008' > PORTE EQU H'0009' > PCLATH EQU H'000A' > > org 0x000 ; The main line code starts here > main > goto init > org 0x010 > init > movlw 0xFF > tris PORTA > > movlw 0x00 > tris PORTC > here > bcf PORTC,2 > bsf PORTC,0 > bcf PORTC,1 > bsf PORTC,2 > nop > nop > nop > goto here > > end > > ____________________________________________________________________ > Get free email and a permanent address at http://www.netaddress.com/?N=1 > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > use mailto:listserv@mitvma.mit.edu?body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST