PDA

View Full Version : How do I poll the register of another device?



dbachman
- 14th December 2008, 22:46
The datasheet of the MT8888 DTMF transceiver says to read the status register and if bit one is set, do the next step. The datasheet says to send b7, b6 and b5 as %110. Do I make portb = %11000000? On the next statement do I say "If portb.1 = 1 then next step"? I'm kind of stuck and any enlightenment would sure help.

Thanks, Don

While thinking about it more, Can I send %11000000 on portb, then "Trisb = $1111111" then do the If Then statement to check if b1 is set?

skimask
- 15th December 2008, 05:29
The datasheet of the MT8888 DTMF transceiver says to read the status register and if bit one is set, do the next step. The datasheet says to send b7, b6 and b5 as %110. Do I make portb = %11000000? On the next statement do I say "If portb.1 = 1 then next step"? I'm kind of stuck and any enlightenment would sure help.
Not seeing any reference to b7,b6,b5 in the datasheet (MT8888C from Mitel/Zarlink) or a couple of other datasheets.
Which datasheet are you using?

dbachman
- 15th December 2008, 14:22
Hi Skimask,

On Page 4-101, the typical control sequence for burst mode applications:

I have wired RSO as portb.7, WR as portb.6 and RD as portb.5.

When I send one of those sequences such as 'Write to transmit data register'
I send %00100111 where I have called RSO -b7(or bit7), WR - b6(or bit6) and RD- b5(or bit5) - portb.5 (b5) is not wired and b3-b0 (bit3 - bit0) is the data.

I hope this makes sense to you.

Thanks, Don

dbachman
- 15th December 2008, 14:58
I have wired RSO as portb.7, WR as portb.6 and RD as portb.5.

- portb.5 (b5) is not wired and b3-b0 (bit3 - bit0) is the data.



The above sould have said:

I have wired RSO as portb.7, WR as portb.6 and RD as portb.5.

- portb.4 (b4) is not wired and b3-b0 (bit3 - bit0) is the data.


I hope this makes sense to you.

Thanks, Don

skimask
- 15th December 2008, 20:23
The above sould have said:
I have wired RSO as portb.7, WR as portb.6 and RD as portb.5.
- portb.4 (b4) is not wired and b3-b0 (bit3 - bit0) is the data.
I hope this makes sense to you.
Thanks, Don
Yep, that makes sense now.
More later when I hit the datasheet a bit more...

You got any code to work with yet? Show it...

dbachman
- 16th December 2008, 01:34
This is what I have been trying:


OSCCON = $60 ' Set up internal oscillator
x var byte
dtmf var byte

CS var portb.4 'Enable or disable MT8888
RD var portb.5 'Read Microprocessor input
WR var portb.6 'Write Microprocessor input
RS var portb.7 'Register Select

Send_DTMF:
TRISB = %00000000
pause 100
portb = %10101101 'Send Control Register A
pause 100
portb = %10100000 'Send Control Register B
pause 100
portb = %00100111 'Send digit = 7
pause 100
portb = %00100101 ' Send digit = 5
pause 100

Goto Send_DTMF

I should mention that this part of the code is just trying to get the thing to spit out a DTMF tone. Beyond that I would need to poll the status register.

Thanks for taking the time to help,

Don