Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

pic 16f84 pin b0 always low

Status
Not open for further replies.

lgeorge123

Full Member level 2
Joined
Jun 13, 2004
Messages
130
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
Hong Kong
Activity points
1,403
pic #int_ext

I use PIC16F84 to measure the time width of TV remote of 9th pulse, it is 1.7ms.
The circuit is OK and the time width is displayed. IR receiver output is connected to pin b0. But after the code is measured, pin b0 of 16f84(external interrupt) is always low, so it cannot trigger more than two times. I am sure the 16f84 is good , the code is as follows :

#include <16f84.h>
#fuses XT,NOWDT,NOPROTECT
#use delay( clock=4000000)
#include "lcd.c"
int time,count,time1;
int32 data1;
#INT_EXT
int_isr()
{
while(!input(pin_b0));
set_rtcc(0);
while(input(pin_b0));
time=get_rtcc();
count++;
if (count==9)
{
lcd_putc('\n');
printf(lcd_putc,"%LX",time);
count=0;
data1=0;
time=0;
}
}
main()
{
count=0;
data1=0;
lcd_init();
printf(lcd_putc,"hello");
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_2);
enable_interrupts(int_ext);
enable_interrupts(global);
WHILE(1)
{
}
}

is it the proporties of 16f84 or anything else ???
Any comment is welcome !!!
 

Hi lgeorge123,
This is a bug on PICs of the 16F Family (as I noticed) that I discovered 3 years ago and which accurs with interrust.
b0 of 16f84 remains always low after the interruption. To resolve this problem you can simply read b0. This was the only one solution that I found.

I hope it help.
Don't forget to press on the helped me button.
Thanks.
Regards,
Master_PicEngineer
 

how do you connect the LCD????
in the picc "lcd.c" it uses all the PORTB, even the RB0 is the enable in the LCD....

do you have another "lcd.c"?????

well. maybe you need to set the TRIS for the RB0... the picc "output_b()" configures always as the port as output... (unless you make a #use fast_io(B))

easier way should be to

set_tris_b(1)

maybe its the way...
 

use this to initialise the driver
in your main .c file just before the main loop
LCD_INITIALMODE(2);

you can follow the commands listing in this c file attached
to set up your printing etc routines
to use it just include it

#include "4bitdriverwithcgramLCD"
it is setup at 20X4 lines mode but this is easily changed

i wrote this class from scratch and it works magic for small
hd 44780 controller types in 4 bit mode
so uses 6i/os and leaves you a few to play with
dont forget to simply redefine the class pins for the pic84's posting on b
remember port b0 and 1 are interrupt pins in 84a
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top