HC908 Oscillator Confusion

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HC908 Oscillator Confusion

2,443 Views
Bloodhound
Contributor I
Hi All,
 
I've spent a bit of time reading posts on here and looking through the HC08 manuals but I am still a little lost on the no comprimise way to set up the clocks on the HC08, I am using a HC908GZ8.
 
Seems to me that if you want to use the MONO8 interface there is some restrictions on the crystal freq?. Anyway, I need to come to a decision on the best oscillator type to use and frequency.
 
My two main requirements are, I want to use the MONO8 interface in the final design and I need to get a baud rate of 8192 on the ESCI.
 
So I am hoping all the helpful people on here might offer some advice on the best oscillator set up?
1 - Do I go for a canned ocscillator?
2 - Do I use a Pierce oscillator set up?
3 - What frequencies am I limited to for MONO8 compatibilty and 8192 baud ESCI?
 
I've recently switched over from AVR's to the HC08. In a previous job I was programming MC68332's in assembler so I'm looking forward to HC08 assembler programming given the nice flexible instruction set the Freescale MCU's have (something I missed on the AVR).
 
Thanks in advance,
Ross
Labels (1)
0 Kudos
Reply
4 Replies

615 Views
Bloodhound
Contributor I
Thanks Ake,
 
So what you are saying is when in MONO8 Mode the crystal speed is irrelevent because the MONO8 interface will inject an overriding 8Mhz frequency? (That's how I read Table 20-1 anyway). I am using the Sotec InDart FYI.
Also, from what I've figured out on the ESCI module, there is enough prescalers and divisors that you can pretty much get any baud rate from a vary wide variety of OSC frequencies so chosing the crystal frequency is not a compromise to ensure you get the exact baud rate.
 
As far as the assembler programming goes, no problems there, between Google and some in depth reading of the CPU08 manual I'll get it sorted. The way I view assembler is the concepts are the same for every CPU, it's just a matter of trying to convert your ideas in to unfamiliar commands. I recently had to port some 68332 assembler to PowerPC (MPC561) Now there's a CPU that was never designed for easy assembly programming, at least if you are coming from the 'easy' to program CPU32.
 
Finally, this is such a newbie question, but, when they are talking in the ESCI baud rate calculation here -  Frequency of the SCI clock source = fBus or CGMXCLK
 
The SCI clock clock source if not using the CGMXCLK is the 'exact' crystal frequency or is it to be divided by 2, 4 ??
 
Cheers,
Ross
 
 
 


Message Edited by Bloodhound on 2007-09-20 07:54 PM
0 Kudos
Reply

615 Views
Nabla69
Contributor V
Hello Ross,
 
Some interfaces do override the XTAL with a stronger canned oscillator frequency.
But also, you can work from your crystal by adapting the baudrate.
I mean there is a direct ratio between the baudrate and the crystal clock.
 
It means that if "The external clock is 8 MHz (7200 baud)" then you can debug with an external clock of 4 MHz @ 3600 baud.

I've done that in the past without any issue.
For the programming, the clock speed is crucial (as it is the base for flash timings), therefore I respect the clock speed of the programming algorithm provided by P&E Micro for my MON08 connection.

I hope this helps :smileywink:

Alfred.

 

0 Kudos
Reply

615 Views
Ake
Contributor II
Hello,
Here is the answers to your questions:
 
1) There are a number of different oscillators for different HC908s, and one should not pick the solution of one MCU and apply it to another.
However, in the case of the HC908GZ8/16, it is OK by using a crystal with two capacitors.
See  Table 20-1 in MC68HC908GZ16 rev 4.
 
2) Yes, use a Pierce oscillator. See chapter 4.3.9.
 
3)  If the oscillator is not a 4 or 8 MHz, the baud rate that is used in the Monitor program will deviate.
That can be compensated by changing the communication speed, but what cannot be compensated is the speed of the erasure/programming of the Flash EPROM.
Therefore, if the 4 or 8 MHz oscillator is not usable in your application, use the crystal that will suit your application. When you want to download new programs, connect an 8 MHz oscillator to the OSC1 pin.
The oscillator will drive the signal much harder than the crystal, so the frequency willl be 8 MHz.
 
Regarding the assembler programming that you talked about, I guess that you would like to see some PLL examples.
But I looked around, and it seems I have not done any HC908GZ8 PLL programming.
 
Regards,
Ake

 

0 Kudos
Reply

615 Views
Alban
Senior Contributor II
Hi Åke !

I also have C code.
Even if it does not give the nicest result, we could post a snippet of the LST file generated from our C code.
This will give both the C and ASM.

Cheers,
Alban.
0 Kudos
Reply