AD76XYZ
Junior Member level 1
Hi,
I was testing port b interrupt.
Am using.
PIC16F886 @4MHz Internal Osc.
CCS C Version 4.105
I have connected LED on A0 and giving low signal on RB7-RB4 but no LED glow.
The pins RB7-RB4 is high, checked by logic probe.
Please where I did mistake.
Whenever I give logic zero to any of pin RB7-RB4 the LED should glow.
I was testing port b interrupt.
Am using.
PIC16F886 @4MHz Internal Osc.
CCS C Version 4.105
I have connected LED on A0 and giving low signal on RB7-RB4 but no LED glow.
The pins RB7-RB4 is high, checked by logic probe.
Please where I did mistake.
Whenever I give logic zero to any of pin RB7-RB4 the LED should glow.
Code:
#include "KBD_WakeUp.h"
#use delay(4000000)
#int_RB
#define LED PIN_A0
void RB_isr(void)
{
clear_interrupt(INT_RB);
output_bit(LED, 1);
delay_ms(500);
}
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
enable_interrupts(INT_RB);
enable_interrupts(GLOBAL);
setup_oscillator(OSC_4MHZ);
// TODO: USER CODE!!
set_tris_b(0x0F);
ext_int_edge(H_TO_L);
output_bit(LED,0);
while(1)
{
}
}