Friday, January 22, 2021

UHSA UART High Speed ASCII

 UHSA stands for UART High Speed ASCII protocol. The protocol is designed to be very low level to be able to tunnel binary data to multiple streams. The encoding is ASCII so it can always be entered from a regular terminal program. The protocol is very simple and can be handled by microcontroller or FPGA code directly.

I really haven't had time to ever publish the protocol, but it is internally used in several products. One of them is TEI0010 a small sensor demo board. It is still available from Arrow online shop.

If you want to use this board for USB to I2C bridge then you need to change IO location for two pins:

You possibly also need to change the IO standard to 3.3V LVCMOS. 

Python source code is also included in the download archive. 

The design if not modified allows I2C and SPI access to all onboard sensors and peripherals.

#
# ADPD register access functions
#
def ADPD_write_reg(reg, value, serialport):
    serialport.reset_input_buffer()          
    cmd = "<c8K%0.2xK%0.2xK%0.2xK>" % (reg, (value >> 8), (value & 0xFF))
    serialport.write(bytearray(cmd,'utf8'))   

def ADPD_read_reg(reg, serialport):
    serialport.reset_input_buffer()          
    cmd = "<c8K%0.2xK<c9K..m..M>" % reg       
    serialport.write(bytearray(cmd,'utf8'))   
    s = serialport.read(4)
    return int(s, 16)

The above is UHSA encoded commands to read write a 16-bit register over the I2C bus.






  

No comments:

Post a Comment