Different response of atomic force microscopy and scanning tunnelling microscopy to charge density waves