PIC16F877A to PC serial port using RS232.
Thu Aug 21 2008, 04:54 pm
Ajay, means i have to connect the collector pin of 2N3904 to pin 33 of PIC16 right? so i would remove VR1, LM324, and 74LS76?
cause since polling is done in software means the flip flops wont be of any use correct? the rest of the circuit is ok?
cause since polling is done in software means the flip flops wont be of any use correct? the rest of the circuit is ok?
Tue Aug 26 2008, 08:03 pm
I am not sure how you are able to compile your code coz i found these errors by just seeing the code.. like
int i=o <<-- zero or o
a[]={63,6,91,79,102,109,125,7,127,,111};
before 111, you have put two commas. Please fix them and try running code again.
int i=o <<-- zero or o
a[]={63,6,91,79,102,109,125,7,127,,111};
before 111, you have put two commas. Please fix them and try running code again.
Thu Aug 28 2008, 01:44 pm
can you please explain what are you trying to do in this program, so will be easier to help out.
Fri Aug 29 2008, 01:53 am
by configuring the 8051 as a negative edge triggered interrupt sensor i set IT1=1 and IT0=1 correct? then TCON=5 and IE=133. how do i write when the 8051 received interrupt from the sensor, it will display 1 on each increment of the interruption?
[ Edited Sun Aug 31 2008, 10:07 pm ]
Wed Sep 03 2008, 02:53 am
making ITx bit 1 will make your interrupts edge triggered, so whenever your signal goes high to low, you will get an interrupt.
to increment 1 at every interrupt you have to write an ISR (interrupt service routine). example
to increment 1 at every interrupt you have to write an ISR (interrupt service routine). example
void INT0ISR() interrupt 0{ //your increment code here for INT0 } void INT1ISR() interrupt 2{ //code for INT1 }
Wed Sep 03 2008, 10:04 am
void INT0ISR() interrupt 0{
i++;
if (i>999) i=999;
P3_1=0;
for (m=0;m<=1000;m++);
P3_1=1;
}
void INT1ISR() interrupt 2{
i--;
if(i<0) i = 0;
P3_0=0;
for (m=0; m<=1000;m++);
P3_1=1;
}
The negative going pulse is applied when the persons interrupts the IR beam from TX2. It will trigger the INT0. The value of the counter increments by '1' when interrupt service routine for INT0 is executed right?
i++;
if (i>999) i=999;
P3_1=0;
for (m=0;m<=1000;m++);
P3_1=1;
}
void INT1ISR() interrupt 2{
i--;
if(i<0) i = 0;
P3_0=0;
for (m=0; m<=1000;m++);
P3_1=1;
}
The negative going pulse is applied when the persons interrupts the IR beam from TX2. It will trigger the INT0. The value of the counter increments by '1' when interrupt service routine for INT0 is executed right?
Powered by e107 Forum System