Hey Alice, good idea, but he needs to change the crystal with a 20MHz one... not 20kHz... your typooo... :) and better, make the tone around 1kHz with the 8MHz crystal, so when using the 20MHz the tone should still audible around 2.5kHz, he will hear it and identify the frequency difference. Generating a 8kHz tone with the 8MHz crystal, when switching to 20MHz the tone should be around 20kHz (why you said 40kHz?) he would not hear anything, not even being sure the circuit is working. Don't have a piezzo? no problem, just make a LED blink once a second using the 8MHz crystal, then count how many blinks do you have in 30 seconds, then switch to 20MHz crystal and repeat the counting in 30 seconds... it should blinks 2.5 times more. Both examples are good to test different capacitors at the crystal, impedances, etc, since you can have visual or audible feedback of the experiments. Best regards, Wagner. Alice Campbell wrote: > > test program and circuit: > > just write a simple delay loop that reduces 4mhz (effective > instruction rate 1 mhz) to about 8khz. put a piezo buzzer at port > b1. toggle b1 at 8khz. replace crystal with 20khz. the low tone at > 8 khz should jump to a high tone at 40 khz. No sound will come out > if it doesnt work. > > alice > > , > > >Please do anyone have a test code with simple circuit > > >for pic16f84 20mhz ? > > -- -------------------------------------------------------- Wagner Lipnharski - UST Research Inc. - Orlando, Florida Forum and microcontroller web site: http://www.ustr.net Microcontrollers Survey: http://www.ustr.net/tellme.htm