OpenCores
URL https://opencores.org/ocsvn/rf6809/rf6809/trunk

Subversion Repositories rf6809

[/] [rf6809/] [trunk/] [software/] [boot/] [i2c.asm] - Diff between revs 13 and 15

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 13 Rev 15
Line 55... Line 55...
; Parameters:
; Parameters:
;               x = I2C controller address
;               x = I2C controller address
; Returns: none
; Returns: none
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 
_i2c_init:
i2c_init:
        pshs    b
        pshs    b
        ldb             #4                                                                      ; setup prescale for 400kHz clock
        ldb             #4                                                                      ; setup prescale for 400kHz clock
        stb             I2C_PREL,x
        stb             I2C_PREL,x
        clr             I2C_PREH,x
        clr             I2C_PREH,x
        puls    b,pc
        puls    b,pc
Line 101... Line 101...
;               accb - data to send
;               accb - data to send
; Returns: none
; Returns: none
; Stack space: 2 words
; Stack space: 2 words
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 
_i2c_xmit1:
i2c_xmit1:
        pshs    d                                                               ; save data value
        pshs    d                                                               ; save data value
        pshs    d                                                               ; and save it again
        pshs    d                                                               ; and save it again
        ldb             #1
        ldb             #1
        stb             I2C_CTRL,x                      ; enable the core
        stb             I2C_CTRL,x                      ; enable the core
        ldb             #$76                                            ; set slave address = %0111011
        ldb             #$76                                            ; set slave address = %0111011

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.