dsPIC30 code for 3B project