40h protocol

adds 40h protocol support, fixes 256 detection bug