gabeNC
Member
I'm pretty sure this is a rookie mistake but I can't quite figure it out. Even tried the "wizard" in Sourceboost to make sure I wasn't doing anything completely stupid with the ADCON registers. Using a 16F877 and have every pin digital and out (except for RA4), driving a 8x8 RGB array. 8 transistors on the column drivers etc. Just ordered some shift registers for later but for now i'm just learning. Here's the code
Here's what the sim shows.

thanks!
Code:
#include <system.h>
//Target PIC16F877 configuration word
#pragma DATA _CONFIG, _PWRTE_OFF & _BODEN_OFF & _WDT_OFF & _LVP_ON & _CPD_OFF & _DEBUG_OFF & _HS_OSC & _CP_OFF
//Set clock frequency
#pragma CLOCK_FREQ 4000000
void ALL_OFF(int delay)
{
porta=000000;
portb=00000000;
portc=00000000;
portd=00000000;
porte=00000000;
delay_ms( delay );
}
void ALL_ON(int delay)
{
porta=111111;
portb=11111111;
portc=11111111;
portd=11111111;
porte=11111111;
delay_ms( delay );
}
void main( void )
{
trisa = 0x00; //Configure ports
trisb = 0x00;
trisc = 0x00;
trisd = 0x00;
trise = 0x00;
//Configure A/D pins
adcon1 = 0x06;
porta = 0x00; //Initialize ports
portb = 0x00;
portc = 0x00;
portd = 0x00;
porte = 0x00;
//Endless loop
while( 1 )
{
ALL_OFF(500);
ALL_ON(500);
}
}

thanks!