working comparator demo based on mspsci