- Joined
- Jul 4, 2009
- Messages
- 16,458
- Helped
- 5,156
- Reputation
- 10,341
- Reaction score
- 5,194
- Trophy points
- 1,393
- Location
- Aberdyfi, West Wales, UK
- Activity points
- 139,286
Brad - the power source is a telephone line, not 50/60Hz mains AC.
L, C1, C2 together resonate at 48 Hz. This could lead to oscillations which can get out of hand (more so if incoming mains is 50 Hz). Destruction of components is possible.
There are two-stage capacitor filters, which have a resistor where you have L. You will not get resonance with such a filter. It would require experimentation to find a satisfactory combination of values.
ASM: org 0x800
Define LCD_BITS = 8
Define LCD_DREG = PORTC
Define LCD_DBIT = 0
Define LCD_RSREG = PORTD
Define LCD_RSBIT = 3
Define LCD_EREG = PORTD
Define LCD_EBIT = 5
Define LCD_RWREG = PORTD
Define LCD_RWBIT = 4
Define LCD_COMMANDUS = 2000
Define LCD_DATAUS = 100
Define LCD_INITMS = 100
Dim volt As Word
ADCON1 = 0x0e
Lcdinit 1
here:
Lcdcmdout LcdClear
Low PORTD.0
Low PORTD.1
Low PORTD.2
Lcdout "Connect Line"
WaitMs 800
If PORTB.7 = 0 Then
Goto there
Else
Goto here
Endif
there:
Lcdcmdout LcdClear
Adcin 0, volt
WaitMs 200
ok:
If volt > 880 Then
Lcdcmdout LcdClear
Lcdout "Line is: OK"
High PORTD.2
WaitMs 800
If PORTB.7 = 0 Then
Goto here
Else
Goto ok
Endif
Endif
boucle:
If volt = 0 Then
Lcdcmdout LcdClear
Lcdout "Line is: BOUCLE"
High PORTD.0
WaitMs 800
If PORTB.7 = 0 Then
Goto here
Else
Goto boucle
Endif
Endif
occuped:
If volt > 128 And volt < 133 Then
Lcdcmdout LcdClear
Lcdout "Line is: BUSY"
High PORTD.0
WaitMs 800
If PORTB.7 = 0 Then
Goto here
Else
Goto occuped
Endif
Endif
What exactly are you trying to measure? on-hook voltage, off-hook voltage, open circuit line, line noise, dialtone level? If it is noise, you need to explain the kind of noise it is.
Brian.
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?