Maker Pro
Maker Pro

Best Pic for keypad and isp?

F

Funky

Jan 1, 1970
0
I'm a hobbyist and I want to design the following:-
To enter via a keypad:-
1. A fundamental frequency from 20 -20kHz, steps of 1Hz.
2. Two multiplication factors from 1 - 10.

The data will be shown on a simple display as it's entered.
The output will be via a jack to headphones, with a volume control and will
be a square wave from 20 - 20KHz, steps 1Hz..

I was thinking about using some sort of pic that perhaps could do the keypad
decoding and display driving as well. But what pic? I haven't got a
programmer but only Mplab. Perhaps there is free software that can enable me
to write in a hi-level language using a simple flash device that can be
programmed in-circuit? Or, if the Pic is too simple, maybe I could use off
the shelf display driver, keboard decoder?

Thanks for any suggestions,
Laz
 
C

Costas Vlachos

Jan 1, 1970
0
Funky said:
I'm a hobbyist and I want to design the following:-
To enter via a keypad:-
1. A fundamental frequency from 20 -20kHz, steps of 1Hz.
2. Two multiplication factors from 1 - 10.

The data will be shown on a simple display as it's entered.
The output will be via a jack to headphones, with a volume control and
will be a square wave from 20 - 20KHz, steps 1Hz..

I was thinking about using some sort of pic that perhaps could do the
keypad decoding and display driving as well. But what pic? I haven't got a
programmer but only Mplab. Perhaps there is free software that can enable
me to write in a hi-level language using a simple flash device that can be
programmed in-circuit? Or, if the Pic is too simple, maybe I could use off
the shelf display driver, keboard decoder?


I don't think you can achieve this with only the PIC. To see why, take the
upper frequency limit of 20 kHz. This has a period T1 = 50 microseconds.
Now, since you specify a step size of 1 Hz, the next frequency will be
19.999 kHz. This has a period of approximately T2 = 50.0025 microseconds.
Subtracting the two periods, we get DeltaT = T2 - T1 = 0.0025 microseconds =
2.5 ns !!! There is no PIC (or any other MCU that I can think of) that can
generate pulse timings in such small time scales...

Your frequency range spans 3 decades. Do you really need such a fine step
size in the mid-upper frequency range? What you could do is to have a step
size of 1 Hz for the low decade (20 Hz to 200 Hz), and then increase the
step size to 10 Hz for the middle decade (200 Hz to 2 kHz), then to 100 Hz
for the upper decade (2 kHz to 20 kHz). Even then, you'll find that the
closer you get to 20 kHz the more difficult it is to generate exactly the
frequencies you want. An external PLL with its set point controlled by the
PIC would probably be the ideal approach.

For the other stuff like keypad and display, they're all easy to do with a
PIC. The 16F877A and the smaller 16F876A are good all-round PICs. There are
loads of resources available on the net for you to use. Do a Google search,
or you could visit http://www.piclist.com/ for a start.

Good luck with the project!

cheers,
Costas
_________________________________________________
Costas Vlachos Email: [email protected]
SPAM-TRAPPED: Please remove "-X-" before replying
 
A

Active8

Jan 1, 1970
0
I don't think you can achieve this with only the PIC. To see why, take the
upper frequency limit of 20 kHz. This has a period T1 = 50 microseconds.
Now, since you specify a step size of 1 Hz, the next frequency will be
19.999 kHz. This has a period of approximately T2 = 50.0025 microseconds.
Subtracting the two periods, we get DeltaT = T2 - T1 = 0.0025 microseconds =
2.5 ns !!! There is no PIC (or any other MCU that I can think of) that can
generate pulse timings in such small time scales...

Your frequency range spans 3 decades. Do you really need such a fine step
size in the mid-upper frequency range? What you could do is to have a step
size of 1 Hz for the low decade (20 Hz to 200 Hz), and then increase the
step size to 10 Hz for the middle decade (200 Hz to 2 kHz), then to 100 Hz
for the upper decade (2 kHz to 20 kHz). Even then, you'll find that the
closer you get to 20 kHz the more difficult it is to generate exactly the
frequencies you want. An external PLL with its set point controlled by the
PIC would probably be the ideal approach.

And since he mentioned that the output goes to a headphone, what's
the smallest pitch shift the ear can discern?

For sound pressure levels 40 dB or more above the audibility
threshold of 0.0002 dyne/cm^2, people with "normal" hearing can
perceive a change in freg of 0.3 of 1% at >= 1000Hz and a change of
about 3Hz is detectable at freq < 1000Hz.

So 20kHz * .003 = 60Hz
For the other stuff like keypad and display, they're all easy to do with a
PIC. The 16F877A and the smaller 16F876A are good all-round PICs. There are
loads of resources available on the net for you to use. Do a Google search,
or you could visit http://www.piclist.com/ for a start.

Damn near everything can be found there or linked to from it.
 
Top