storage var

if first frequency from d0 is 1200 and the others (from d0)

I might be missing something here, but it appears that you want to connect 5 things to one pin, and somehow guess which one you are reading from at any point in time.