IIC on a MC68HC908JL16 Assembly Language

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IIC on a MC68HC908JL16 Assembly Language

692件の閲覧回数
i_kauf
Contributor III

Hello to all!

 

I working on a communication between an MC68HC908JL16 an a IIC device. I have a working write routine but I can not read from my IIC device.

 

write:

 mov I2C_adr,MMADR

 mov I2C_data,MMDTR

 bclr 3,MIMCR                 ;Transmit

 bset 4,MIMCR                 ;Start

 brclr 1,MMSR,*               ;MMDTR empty-flag

 bclr 4,MIMCR                 ;Stop

 rts

 

Read:

 mov i2C_adr,MMADR

 bset 0,MMADR               ;read bit set  

 bclr 3,MMCR                 ;Ack

 bset 3,MIMCR                ;Receive

 bset 4,MIMCR                ;Start

 brclr 0,MMSR,*             ;MMDRR full      The program stops always here and does not work further

 bclr 4,MIMCR                ;Stop

 mov MMDRR,I2C_Data

 rts

 

There must be an little error in my read routine. Can anyone help me please?

 

Regards,

 

Ingo

ラベル(1)
0 件の賞賛
1 返信

316件の閲覧回数
RogerSchaefer
Contributor III

Hello Ingo,

 

Don't know about the JL16 exactly but I have some assembly code for IIC in the MC9S08SH8 at this site:

 

http://www.rasmicro.com/DS1307.htm

 

 

Roger

0 件の賞賛