Simulating a simple RC circuit using an arduino and the circuit's equivalent discrete-time transfer function
I think it's problem of scaling the coefficients from your first-order filter equation. So, you can manipulate the values with proper precision, instead of simply converting to uint8_t the result of the sums / multiplications, as you are doing.
Since at the end you will restrict the output of the filter to 8 bits (DAC) and also to avoid using 32 bit variables, I suggest to define a scale factor of 256. 
In this way, it will be necessary to use only 16-bit variables (uint16_t) for MAC operations. 
The analogRead() function returns a number from 0 to 1023 (10 bit ADC). For reasons similar to those already discussed, I will limit the result
from digital conversion to 8 bits (division by 4, or right shift by 2 bits). So:

uint16_t u_n;
u_n = analogRead(A0) &gt;&gt; 2;


The original equation:

$$ x_n=0.855072x_{n-1}+0.072464\left ( u_n+u_{n-1} \right ) $$

Will be converted to:

$$ 256x_n= 219x_{n-1}+19\left ( u_n+u_{n-1} \right ) $$

and implemented in code, with rounding, as:

x_n = (219*x_n_1 + 19*(u_n + u_n_1) + 128) &gt;&gt; 8;


In the resulting plot (\$ T_s=0.5 ms \$) it's possible to notice that the system, when excited approximately at the frequency of the pole (50 Hz), exhibits a response with magnitude 0.707 (-3 dB) of the input and phase lag of 45 degrees. It's worth remembering that, for example, a 4V voltage is equivalent to a digital value of 4/5 * 256 (aprox. 204).



UPDATE:

You may notice in the previous plot the effect of discretization with insufficient precision, for example the presence of a DC offset error. Thus, by changing the scaling factor to 1024 and using 32-bit variables, it's possible to minimize the discretization error:

uint32_t u_n;
u_n = analogRead(A0) &gt;&gt; 2;


The scaled equation will be:

$$ 1024x_n= 876x_{n-1}+74\left ( u_n+u_{n-1} \right ) $$

and implemented in code, with rounding, as:

x_n = (876*x_n_1 + 74*(u_n + u_n_1) + 512) &gt;&gt; 10;


With plot: