Shop OBEX P1 Docs P2 Docs Learn Events
SX48DB: Port Write Error — Parallax Forums

SX48DB: Port Write Error

CranehillCranehill Posts: 4
edited 2008-03-04 05:30 in General Discussion
Hello there!

I am now developing some product using two SX48ProtoBoards(with SX-Keys) which communicate with each other through RE port.
But the value I try to write in RE port connected to the other SX48·is· written differently in the register sometimes ,not always in SX-Key's Debug-Run mode.
In other words, different value is written.

The source code is as follows:


;////////////////////////////
; Transmit byte data
;////////////////////////////


:transmit_next_byte

··mov·W,#$1F···;Mode=Directopn
··mov·M,W
··;mov·· ·RE,#%0000_0000········ ·;must specify port before dir set
··mov···· !RE,#RW_bus_ta_TX_DIR·;transmit mode dir.

; tx upper nibble
··mov·RW_temp,RW_read_val
··and·RW_temp,#%1111_0000
··clc
··rr·RW_temp···;rotate right * 4
··rr·RW_temp
··rr·RW_temp
··rr·RW_temp
··mov·RW_tx_upper_nibble_log,RW_temp

··mov·W,RE
··and·W,#%1111_0000··;mask the lower nibble

··or·W,RW_temp
··mov·RE,W···;transmit upper nibble

··nop····;REV097Gz1e

··mov·RW_tx_upper_nibble_phy,RE

;
··nop····;read-modify-write consideration?
··nop
··nop
;
··setb·RW_STRB_to_mx_pin·;RW_STRB:the Target
> Master



For example, though W value before 'mov RE,W' is $0A, RE value after the execution of the instruction is $08.


I·don't know this problem is related with· "Read-Modify-Write Considerations" in the data sheet.
But·can you explain more details about it?

Cranehill
JAPAN
·

Comments

Sign In or Register to comment.