Discussion in "PIC Microcontroller Discussion" started by    needginer    Mar 2, 2008.
Thu Aug 21 2008, 04:54 pm
#41
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?
Fri Aug 22 2008, 12:14 am
#42
Yup that's right.
Tue Aug 26 2008, 07:29 pm
#43
...


[ Edited Sun Aug 31 2008, 10:00 pm ]
Tue Aug 26 2008, 08:03 pm
#44
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.
Wed Aug 27 2008, 01:02 pm
#45
.


[ Edited Sun Aug 31 2008, 10:02 pm ]
Thu Aug 28 2008, 01:44 pm
#46
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
#47
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 ]
Tue Sep 02 2008, 01:07 pm
#48
is it correct?
Wed Sep 03 2008, 02:53 am
#49
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

void INT0ISR() interrupt 0{
     //your increment code here for INT0
}

void INT1ISR() interrupt 2{
     //code for INT1
}
Wed Sep 03 2008, 10:04 am
#50
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?

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am
ArnoldDiant
Fri Apr 26 2024, 03:53 am
RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm