prevravanth
New Member
Hi,
I am using 80C51 with crystal 11.0592Mhz, an external oscillator for 100 Khz generation of CLK to DTMF transmitter HT9200A
I dialled no 30.
I used DTMF output interface circuit as mentioned in Holted forum
Problem is some times it dials & sometimes it doesnot work.. Please find any bug in the code
or suggest me to how dial correctly
void main(void)
{
TMOD=0x01;
TL0=0xB2; // TL0 Reload value
TH0=0xFE; // TH0 Reload value 1 Khz
ET0=1;
TR0=1; // Start Timer0
EA=1;
P0_1 = 0; // 100KHz CLK started from external 555 timer
dial();
while(1)
{
//delay(1000);
}
}
void timer0() interrupt 1 // interrupt address is 0x000b
{
TF0 = 0; // reset interrupt flag
TL0=0xB2; // TL0 Reload value
TH0=0xFe; // TH0 Reload value 1 Khz
}
void dial()
{
P0_0 = 0; // CE Enable Chip
delay(9216); // Delay for 10ms after CE selected
P0_2 = 1; // D0
P0_2 = 1; // D1
P0_2 = 0; // D2 Send Digit 3
P0_2 = 0; // D3
P0_2 = 0; // D4
P0_1 = 1; // CLK off
delay(5000);
P0_1 = 0; // CLK ON
P0_2 = 1; // D0
P0_2 = 1; // D1
P0_2 = 1; // D2 Stop DTMF
P0_2 = 1; // D3
P0_2 = 1; // D4 */
P0_1 = 1; // CLK off
delay(5000);
P0_1 = 0; // CLK ON
P0_2 = 0; // D0
P0_2 = 1; // D1 // Send Digit 0
P0_2 = 0; // D2
P0_2 = 1; // D3
P0_2 = 0; // D4
P0_1 = 1; // CLK off
delay(5000);
P0_1 = 0; // CLK ON
P0_2 = 1; // D0
P0_2 = 1; // D1
P0_2 = 1; // D2 Stop DTMF
P0_2 = 1; // D3
P0_2 = 1; // D4
}
I am using 80C51 with crystal 11.0592Mhz, an external oscillator for 100 Khz generation of CLK to DTMF transmitter HT9200A
I dialled no 30.
I used DTMF output interface circuit as mentioned in Holted forum
Problem is some times it dials & sometimes it doesnot work.. Please find any bug in the code
or suggest me to how dial correctly
void main(void)
{
TMOD=0x01;
TL0=0xB2; // TL0 Reload value
TH0=0xFE; // TH0 Reload value 1 Khz
ET0=1;
TR0=1; // Start Timer0
EA=1;
P0_1 = 0; // 100KHz CLK started from external 555 timer
dial();
while(1)
{
//delay(1000);
}
}
void timer0() interrupt 1 // interrupt address is 0x000b
{
TF0 = 0; // reset interrupt flag
TL0=0xB2; // TL0 Reload value
TH0=0xFe; // TH0 Reload value 1 Khz
}
void dial()
{
P0_0 = 0; // CE Enable Chip
delay(9216); // Delay for 10ms after CE selected
P0_2 = 1; // D0
P0_2 = 1; // D1
P0_2 = 0; // D2 Send Digit 3
P0_2 = 0; // D3
P0_2 = 0; // D4
P0_1 = 1; // CLK off
delay(5000);
P0_1 = 0; // CLK ON
P0_2 = 1; // D0
P0_2 = 1; // D1
P0_2 = 1; // D2 Stop DTMF
P0_2 = 1; // D3
P0_2 = 1; // D4 */
P0_1 = 1; // CLK off
delay(5000);
P0_1 = 0; // CLK ON
P0_2 = 0; // D0
P0_2 = 1; // D1 // Send Digit 0
P0_2 = 0; // D2
P0_2 = 1; // D3
P0_2 = 0; // D4
P0_1 = 1; // CLK off
delay(5000);
P0_1 = 0; // CLK ON
P0_2 = 1; // D0
P0_2 = 1; // D1
P0_2 = 1; // D2 Stop DTMF
P0_2 = 1; // D3
P0_2 = 1; // D4
}