I did a quick Google search on the phrase "PIC frequency counter", and the first page was just full of interesting projects of this sort.
formatting link
is one such.
You can also go to
formatting link
and download their AN592 application note, which is for a frequency counter using the PIC16C5x chips.
Googling on "8051 frequency counter" shows a link to
formatting link
where there is a project of that sort, I think.