abstract: It is well-known that the geodesic flow on the modular surface SL(2,Z)H is related to the continued fraction expansions of real numbers, and in particular to the Farey and the Gauss maps. In this talk I will present a Poincaré map for the horocycle flow on SL(2,Z)H from which one obtains: a coding for the closed horocycles in terms of the rational numbers as ordered in the Stern-Brocot tree; a relation of the horocycle flow with the backward continued fraction map. The talk is based on joint work with Alessio Del Vigna and Stefano Isola.