PDA

View Full Version : xtal problem.



Rhatidbwoy
- 14th October 2005, 19:48
I have PICBasic and I would like to know how you would define or declare in the program that you are using a xtal that is other than 4MHz

Dave
- 14th October 2005, 22:25
Rhatidbwoy, All you would do is place this define at the top of your program:

DEFINE OSC 20 '20 Mhz
DEFINE OSC 8 '8 Mhz

Dave Purola,
N8NTA

mister_e
- 15th October 2005, 14:10
and don't forget the configuration fuse... See FAQ to know how to set them in the code.

Usually.. XT = 4MHZ HS > 4 MHZ

Rhatidbwoy
- 16th October 2005, 00:27
ok got it.

the other thing is that I was speaking to a tech at Mechanique and he was talking about how the program does not really need that in it. That is the PICBasic using the MicroCode Studio. The one thing that I would have to do is to change the time constant commands by five when using a 20MHz Xtal

Rhatidbwoy
- 16th October 2005, 19:55
The other thing tha I would like to mention is that Define OSC 20 in PICBasic does not really give any other that error.

Brewster
- 19th October 2005, 14:39
I just went through a similar problem trying to change crystal frequencies.
This is what I found:

DEFINE is only available in PicBasic PRO.

In MicroCode Studio, you can change the oscillator type, XT, HS, R/C, etc.
After you have clicked on "compile and program", the next box to come up is "meProg-......". Click on VIEW and then CONFIGURATION ( you might have to click CONFIGURATION twice). The meProgram screen will come up and you can make changes to the oscillator there.

You will still have to compensate for a different oscillator frequency in your program.

Good Luck
Brewster............another newby

Rhatidbwoy
- 28th October 2005, 01:50
I got the whole xtal thing to go. I am using the intrc right now, but yes it is a program orientated thing in PICBasic.

Thanks

P.S. problems that I was having with everything to my project was the power supply in my computer. It died the other day.