Hi Doug, It is a Homer moment - for me. I *think* that this application is the only one that does not go directly to the PIC16F877. The problem is that I didn't make sure that this code (it's only a few lines, so why bother right?) changed the PORTA bits to Digital I/O when the PIC16F877 is selected. Here is the corrected code: title "ledon - Turn on a LED when a Button is Pressed" ; ; This is the First Program to be Burned in and Run in a PIC. ; ; The Program simply sets up Bit 0 of Port "A" to Output and then ; Sets it Low when RA0 is pulled low. ; ; Hardware Notes: ; _MCLR is tied through a 4.7K Resistor to Vcc and PWRT is Enabled ; A 220 Ohm Resistor and LED is attached to PORTB.0 and Vcc ; A 10K pull up is connected to RA0 and it's state is passed to ; RB0 ; ; Myke Predko ; 99.12.03 ; 02.01.10 - Added Write to "ADCON1" to Put PORTA in Digial I/O ; mode ; LIST R=DEC ifdef __16F84 INCLUDE "p16f84.inc" endif ifdef __16F877 INCLUDE "p16f877.inc" endif ; Registers ifdef __16F84 __CONFIG _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON else __CONFIG _CP_OFF & _DEBUG_OFF & _XT_OSC & _PWRTE_ON & _WDT_OFF & _LVP_OFF & _WRT_ENABLE_ON & _BODEN_ON & _CPD_OFF endif __IDLOCS 0x01234 PAGE ; Mainline of ledon org 0 nop ; "nop" is Required for Emulators bsf PORTB, 0 ; Make the LED on PORTB.0 "off" bsf STATUS, RP0 ; Goto Bank 1 to set Port Direction bcf TRISB ^ 0x080, 0 ; Set RB0 to Output ifdef __16F877 movlw 7 ; Make PortA Digital I/O for PIC16F877 movwf ADCON1 ^ 0x080 else nop ; Make sure Space required is always the same nop endif bcf STATUS, RP0 ; Go back to Bank 0 Loop movf PORTA, w ; Simply Transfer PORTA.0 to PORTB.0 movwf PORTB goto Loop end I put the code to write to ADCON1 as conditionally assembling so that there wouldn't be an problem with the PIC16F84. Sorry for the hassles: D'Oh! myke ----- Original Message ----- From: "Doug Hemingway" To: Sent: Tuesday, February 05, 2002 1:28 AM Subject: [PIC]: 16F877 Oscillator > Sorry, I didn't put the correct subject router the first time. > > I have just gotten my first 16F877 and have programmed it to do a simple > "turn on the led" program (the LEDON program in Myke's book, where RB0 > should follow the state of RA0). It is so simple it doesn't work. The XT > oscillator config is programmed, but on the OSC1/CLKIN pin 13 I see a > tristate condition. On OSC2/CLKOUT pin 14 I see the oscillator frequency. > I am using a 3 pin ceramic resonator with the center pin grounded. Both Vdd > and both Vss pins are correctly connected, and the MPU is bypassed with > .1uF. MCLR is tied high through a 1K resistor. Anyone have any suggestions > on how to get past this Homer Moment (D-OH!) > > TIA, > Doug Hemingway > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu