hi i have a problem with my PIC18f4550 the simulator result is as required but the hardware isn't [CODE] unsigned char a,b; float r ; float temp; float P_R[3] = {-17,7,10}; /*read from RF module*/ ADCON1 = 0xFF; TRISD = 0x00; TRISB = 0x00; temp = (1.4+P_R[0])/30; r = pow( 10,temp ); r = 1/r; a = (unsigned char) r; b = (unsigned char)((r-a)*10); PORTB = b; PORTD = 3; [/CODE] the value sent to PORTB never appears but when i assign direct value to PORTx it works as PORTD also if i assign that value to the variable then send it to PORTx [code] a = 3; PORTB = a; [/code] but i need to get the calculated value from equation???? -- View this message in context: http://www.nabble.com/can%27t-send-calculated-value-to-PORTB-tp21752352p21752352.html Sent from the PIC - [PIC] mailing list archive at Nabble.com. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist