ya adak, i get what u mean. thank anyway for the great help. okie now i show u the previous work i done.it only can read 2 digit.
actually, it worked but the problem is that the board got a problem that TXBUF0 is a 8 bit so i can only read 2 digit. so anything mnore than 100 ,it will only take the last 2 digit. so i change the value to a hexadecimal so when the digit is more than 100 it will also be 2 digit. ya so it can read it than after that from the hexa than i will convert back to decimal again.
if(char_gen[(heartrate & 0xf0) >> 4]>4 || char_gen[(heartrate & 0xf00) >> 8]<2)
TXBUF0 = 92160/pulseperiod; // Transmit buffer
so this is the latest 1 i put inside tghe heart rate board. but it seem like it only transmit out the 1st data only. after that it hang.
num = 92160/pulseperiod;
for (int i=1; i>=0; i--)
TXBUF0 = output + output;