Page 1 of 1

Simple output not working

Posted: Sun Aug 20, 2006 2:45 am
by ukweb
Using matrix multimedai board v2
PIC 16f876

Following program

Code: Select all

#include <system.h>

main()
{
set_bit(STATUS, RP0); //SELECTS BANK 1
TRISB=0x00;  //MAKES PORTB OUTPUT
TRISA=0xff;  //MAKES PORTA INPUT
clear_bit(STATUS, RP0);  //SELECTS BANK 0
if(input_pin_port_a(0))
{
PORTB=0xff;
}
else
PORTB=0x00;
}


Compiles and assembles (hex file). burns to the chip... but does not show the expected out put at all.

What settings are to be used like RC or XT on the board.
FAST or SLOW settings, to make the program work.

Posted: Mon Aug 21, 2006 9:28 am
by Ian
Did you turn the Analogue pins off?
A0 is analogue by default unless turned off.

Add the following to the program:

//PIC Initialisation
adcon1 = 0x07;