In this paper we present an analysis of the stability of a two-degree-of-freedom system, modeling a robotic arm connected to the actuator through an elastic joint and subject to digital position control. The system consists of two lumped masses connected to each other through a spring and a damper. In the model there is only one actuator, so the system is underactuated in a certain sense; two cases are considered, referring to a collocated and a noncollocated configuration. Stability analysis is presented using both a continuous and a discrete time approach. The discrete time approach is related to the case of a digital controller, typical in real applications. This samples the position and the velocity signals at discrete time intervals and, therefore, it generates a piecewise constant control force, introducing a delay in the control system as well. The stability charts are presented in the parameter space of the sampling time and the control gains. Their differences highlight the role played by the resonances between the finite sampling frequency and the natural frequency of the system in achieving robust stability with respect to parameter variations.