Maker Pro
Maker Pro

Frequency divider with PIC and quartz oscillator

stefangs

Oct 26, 2010
6
Joined
Oct 26, 2010
Messages
6
Hello! I'm trying to build a simple frequency divider that involves a PIC and a quartz oscillator. It is not my domain so i kinda need some help in choosing and programming the pic. The ideea is that i should get a random frequency from the quartz oscillator (it is a didactic project so the division and the main freq doesnt need to have a certain value) and that freq to be divided by the pic and displayed on to a LCD or a oscilloscope. I would appreciate if you guys can help me with a schematic and a source code for the pic. As I said , im not that good at these things. Thanx!
 

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
What is your application for this project? is it homework?? is it nessesary to use a pic for this application?? there are simpler ways of frequency division.

Please give more information
 

stefangs

Oct 26, 2010
6
Joined
Oct 26, 2010
Messages
6
Yes it a project for school. I have to make a comparation between a JK flip flop freq divider and a PIC programmed freq divider with quartz oscillator.
 

stefangs

Oct 26, 2010
6
Joined
Oct 26, 2010
Messages
6
and i have to build the two of them, and i kinda need some help on the PIC one
 

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
Ok what language are you using?? I would imagine if it is a school project that you are using C++? or C#.
 

stefangs

Oct 26, 2010
6
Joined
Oct 26, 2010
Messages
6
thats the problem, the PIC i think it has to be programmed with MPlab, i dont know if MPlab is in C.
 

stefangs

Oct 26, 2010
6
Joined
Oct 26, 2010
Messages
6
but i dont think that if its programmed in another language and software would be a problem
 

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
MPlab can be used with a variety of languages with the main two being assembly and C. My suggestion would be to look at how the JK flipflop Circuit is able to divide frequency (i would also look at a variety of other methods for instance using D-type FF's or a 555 Timer to divide frequency).

Then make a list of what comands you may need to do this using programing. Look into interupts and timer prescalers also have a look on the web at the programing techniques used in frequency counters. And see if you can figure out how this may relate to frequency division. When writing programs i like to start with building blocks (like a flow chart or brain map) and see if i can get it to work on paper before i try and get it to work on the PC. Make sure you make plenty of notes and document your program well this will ensure that if you get stuck you can easily go back and see what you were trying to do.

If you get stuck on any specifics come back here and someone will try and help you. as it is homework you should first try to tackle the problem yourself or you will never learn the lesson this particular assignment is supposed to teach you.
 

stefangs

Oct 26, 2010
6
Joined
Oct 26, 2010
Messages
6
ok thx, i will try, i'll post a source code and if it needs ajustements maybe you can help me.
 
Top