Hi , i think the problem with your watch dog reset is as soon when you mov the value of CH into ccap4h register this will reset the uC as both will get matched
View all questions in Keil forum