Jim, I see you are using the INTRCOSC, and I assume it defaults to 4mhz since I don't see any frequency setting code. So, if that is the case, the only thing I can see that might be an issue is that you are switching PORTB on and off at about a 1 MHZ rate, so if you have LED's connected, all you'll probably see is a Dim LED brightness. Look at the pins with a scope to see if they are actually toggling. Or add a delay after you tunr PORTB on, and again after you turn it OFF so you have time to see if they are toggling. Regards, Jim > -------- Original Message -------- > Subject: PIC16F876A not changing output pins > From: Jim > Date: Thu, March 03, 2011 10:05 am > To: piclist >=20 >=20 > Hello, I am having trouble with a PIC16F876A, on an Olimex 28-pin dev boa= rd > (see http://www.sparkfun.com/products/18). The program downloads and > verifies successfully (or so the software tells me) via an meLabs U2 USB > programmer. In the past, I've had a couple PIC18 chips partially die on = me > without losing their ability to be programmed, so I'm wondering if that's > the case here, or if there's something wrong with my code. I have been > careful about grounding myself while handling both chips, although it's > possible that I forgot at some point while working on it with little slee= p. >=20 >=20 > I am trying to toggle all the pins of PORTB as a "hello world" test. It > works in the simulator, but apparently does nothing on the board. I have > already checked the supply voltage (+5.05V) and tested both chips on a > breadboard with all the I/O ports connected to GND with 1k resistors as > suggested here http://www.piclist.com/techref/logic/xtrapins.htm. Still > nothing on my scope. Here is my assembly code: >=20 > list p=3D16f876a ; list directive to define processor > #include "p16f876a.inc" ; processor specific variable definitions > __CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _RC_OSC & _LVP_OFF= & > _DEBUG_OFF & _CPD_OFF >=20 > ; '__CONFIG' directive is used to embed configuration data within .asm fi= le. > ; The lables following the directive are located in the respective .inc > file. > ; See respective data sheet for additional information on configuration > word. >=20 > ;***** VARIABLE DEFINITIONS > ;; w_temp EQU 0x70 ; variable used for context saving > ;; status_temp EQU 0x71 ; variable used for context saving >=20 > ;********************************************************************** > ORG 0x000 ; processor reset vector > clrf PCLATH ; ensure page bits are cleared > ; goto main ; >=20 >=20 > ;; initialize PORTA > bcf STATUS, RP0 ; select bank 0 > bcf STATUS, RP1 > clrf PORTB >=20 > bsf STATUS, RP0 ; select bank 1 > movlw 0x06 > movwf ADCON1 > movlw 0x00 > movwf TRISB >=20 > top: > bcf STATUS, RP0 ; select bank 0 > movlw 0x00 > movwf PORTB > movlw 0xFF > movwf PORTB > goto top > END ; directive 'end of program' >=20 > Is there something wrong with this code, or is it definitely a hardware > issue? >=20 > Thanks, > Jim > --=20 > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .