Digital to Analog converter with DAC5311, Any suggestion?
Classical +/- 1 problem

If you do this calculation by hand uint16_t temp = int(voltage * pow(2, 8) / max_VOLT);
you will get temp=256 and this is a value you can not convert with a 8 bit DAC.

Try uint16_t temp = int(voltage * (pow(2, 8)-1) / max_VOLT); instead.

(or event better for a µC uint16_t temp = (uint16_t) (voltage * (255 / max_VOLT));)