Help
Advanced Member level 2
- Joined
- Feb 15, 2005
- Messages
- 617
- Helped
- 7
- Reputation
- 14
- Reaction score
- 3
- Trophy points
- 1,298
- Activity points
- 7,065
We only can use idle_1 but i am sure the INT0 is '1' when we never connecting the OUT because i got measure it (between the OUT and INT0 i have add one driver Gate 7404, i think from there we already invert the signal already.). Now i also worry whether the OUT signal is stable on Hi/Lo not when no key pressed. If not the 7404 will hap-logic(sometime Hi, sometime Lo). May be because of that we get the idel_1 no data graph. I confirm it again then let you know.budhy said:1. You use idle_1, it mean when no key pressed the voltage at INT0 is '1'. But why there is idel_1 no data graph? Does it mean without any key pressed there are still a pulses stream on OUT pin?
The CYCLE(blue bar) is nothing, it just let us know the number Buffer data. We have 70 data in buffer.budhy said:2. What is the meaning of CYCLE (blue bar)?
#define size 70
idata char time[size];
void capture_idle_0(void){
char i,wait;
do {
TH0=0; TL0=0; TR0 = 1;
while (!INT0) ;
wait = ((256*TH0)+TL0<10000);
if wait while (!INT0) ;
) while wait;
i = 0;
while (i<=size){
TH0=0; TL0=0; TR0 = 1;
while (INT0); TR0 = 0;
time[i++] = TL0;
TH0=0; TL0=0; TR0 = 1;
while (!INT0);TR0 = 0;
time[i++] = TL0;
}
}
void main(void){
TMOD = 0x01;
IT0 = 0;
capture_idle_0(); // if the idle state on INT0 is '0'
}
void capture_idle_1(void){
char i,wait;
do {
P1_0 = 0;
TH0=0; TL0=0; TR0 = 1;
while (INT0);
wait = ((256*TH0)+TL0<10000);
if(wait)
{
while(INT0);
}
}while(wait);
P1_0 = 1;
i = 0;
while (i<=(time0-1)){
P1_1 = 0;
TH0=0; TL0=0; TR0 = 1;
while (!INT0); TR0 = 0;
time_idle_1[i++] = TL0;
P1_1 = 1;
TH0=0; TL0=0; TR0 = 1;
while (INT0);TR0 = 0;
time_idle_1[i++] = TL0;
P1_1 = 0;
}
P1_1 = 1;
}
do {
TH0=0; TL0=0; TR0 = 1;
while (!INT0) ;
wait = ((256*TH0)+TL0<10000);
if wait while (INT0) ;
) while wait;
void capture_idle_1(void){
char i,wait;
do {
TH0=0; TL0=0; TR0 = 1;
while (INT0) ;
wait = ((256*TH0)+TL0<10000);
if wait while (!INT0) ;
) while wait;
i = 0;
while (i<=size){
TH0=0; TL0=0; TR0 = 1;
while (!INT0); TR0 = 0;
time[i++] = TL0;
TH0=0; TL0=0; TR0 = 1;
while (INT0);TR0 = 0;
time[i++] = TL0;
}
}
do {
TH0=0; TL0=0; TR0 = 1;
while (!INT0) ;
wait = ((256*TH0)+TL0<10000);
if wait while (INT0) ;
) while wait;
void capture_idle_1(void){
char i,wait;
do {
TH0=0; TL0=0; TR0 = 1;
while (INT0) ;
wait = ((256*TH0)+TL0<10000);
if wait while (!INT0) ;
) while wait;
i = 0;
while (i<=size){
TH0=0; TL0=0; TR0 = 1;
while (!INT0); TR0 = 0;
time[i++] = TL0;
TH0=0; TL0=0; TR0 = 1;
while (INT0);TR0 = 0;
time[i++] = TL0;
}
}
Yes! Make a table from each Key!You mean unique space/mark period table = time[] buffer ?
int time[70];
...
...
time[i++] = 256*TH0 + TL0;
...
zanor said:Did you get this to work? I'm trying to use the exact same reciver as you! Could you please give out the working code?
void capture_idle_1(void){
char i,wait;
do {
TH0=0; TL0=0; TR0 = 1;
while (INT0) ;
wait = ((256*TH0)+TL0<10000);
if wait while (!INT0) ;
) while wait;
i = 0;
while (i<=size){
TH0=0; TL0=0; TR0 = 1;
while (!INT0); TR0 = 0;
time[i++] = TL0; // Capture Result
TH0=0; TL0=0; TR0 = 1;
while (INT0);TR0 = 0;
time[i++] = TL0; // Capture Result
}
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?