add new code to chx and spi