Periodic and chaotic motions of a harmonically forced piecewise linear system