Problem with MC9S08AW60 I2C with Built-in vol ctrl Amplifier

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Problem with MC9S08AW60 I2C with Built-in vol ctrl Amplifier

2,443 次查看
mylim
Contributor IV
I’m using freescale MC9S08AW32 MCU with i2c port to interface with an NSC LM49270 audio amplifier with built-in vol ctrl. 
I can't seem to see my data being transmited over the scope & couoldnt control the amplifier.

What I’ve done is as follow;
1.                   Pull up both SDA & SCL line.
2.                   code : (which you may ignore the code portion but only the descriptions I left to indicate my process)
Code:
;--------------------
;LM49270 Vol Ctrl
;--------------------
i2cvol         bclr   IIC1C_TXAK,IIC1C         ;
               lda    IIC1C
               ora    #$30                     ;start
               sta    IIC1C
           
               mov    #I2CADR,IIC1D            ;send slave address(W)
               brclr  IIC1S_TCF,IIC1S,*
               brset  IIC1S_RXAK,IIC1S,*       ;wait for ACK from slave            
 
               lda    I2CDTA                   ;data to be transmited 
               sta    IIC1D                    ;send data
               brclr  IIC1S_TCF,IIC1S,*
               brset  IIC1S_RXAK,IIC1S,*       ;wait for ACK from slave
           
               bclr   IIC1C_MST,IIC1C          ;generate stop
               rts
 

 
The LM49270 is a write only i2c which it doesn’t’ have a read register for me to read & confirm the data sent.
I've also attached the datasheet as below.
 
3.            I2C configuration:
               SCL = 25kHz
               SDA Hold time = 10us
               IIC1F = 0x87
               IIC1C = 0x90
              
           
Could you please advice & let me know asap.
Thanks.
mingyee



Message Edited by mingyee on 2007-08-21 01:38 PM

LM49270.pdf

Message Edited by t.dowe on 2009-09-22 09:41 AM
标签 (1)
0 项奖励
回复
3 回复数

936 次查看
mylim
Contributor IV
I've posted some graph & print screen i've captured.
Hope it will be useful for you guys to help me look into this problem.
Thanks.
 
Regards,
mingyee
0 项奖励
回复

936 次查看
bigmac
Specialist III
Hello mingyee,
 
The waveform shown in your picture1.jpg file does seem to be correct for a command value of 0x76, i.e. set headphone gain to 4.5dB.  But I would assume that the ADR pin needs to be set low to match the address byte you are sending.  However, the amplifier does seem to be returning an ACK bit, so the address is probably OK.  Did you previously write a command to the shutdown control register to enable the device?
 
Regards,
Mac
 
0 项奖励
回复

936 次查看
mylim
Contributor IV
Hi Bigmac,
Thanks.
I've managed to solve the problem.
The HPS pin wasnt pull low to activate the loudspeaker.
It's kindda silly though.
Thanks anyway.
 
Regards,
mingyee
0 项奖励
回复