Program to directly measure microprocessor bus clock

Publisher:知识智慧Latest update time:2014-09-17 Source: ednchina Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  Verify the bus frequency of the HC08 SCS08 microprocessor using a single control loop .

  Freescale's HC08 and newer HCS08 microprocessor families feature common peripheral modules. Clock generators are no exception. They range from internal clocks from any I/O pin to external crystals or oscillators. Once the clock source is selected, there are a variety of options for controlling the final bus frequency. For example, connecting a 32,768Hz crystal to the MC9S08GB microprocessor allows the use of an FLL (frequency locked loop) to generate a bus frequency of up to 18.874 MHz. Selecting the source, divisor, and FLL allows for a versatile and complex setup.

  Once you have written the bus clock initialization routine , you may want to verify that the bus is running at the expected speed before continuing with the rest of the project. This design proposal shows a routine (Listings 1 and 2) that outputs a square wave at any I/O port at exactly 1/9 the speed of the bus. Simply connect a frequency counter to this pin to display the bus frequency. All you have to do is move the decimal point one place to the right. Once you have verified the bus speed, you can write timers, serial I/O, and other clock-related routines with confidence.

  Just write the code, first turn off interrupts and COP (Common On-Chip Processor). In the bus clock initialization routine, make sure to initialize the I/O ports you want to use as outputs. Then, just jump to the toggle clock and output the bus frequency divided by 10 until power is removed. This design uses the HC08 version of PB0 (

Listing 1) and the HCS08 version of PD0 (Listing 2). By changing the first line to identify the port and the second line to select the bit, any suitable I/O port can be used. This design also names the port with the old symbol PB, instead of the now commonly used PTB.

  Original English:

  Routines directly measure microcontroller-bus clock

  You can verify the bus frequency of the HC08 SCS08 microcontroller with simple control loops.

  Kerry Erendson, Bulova Technologies; Edited by Charles H Small and Fran Granville -- EDN, 10/25/2007

  The Freescale HC08 and newer HCS08 microcontroller families have versatile peripheral modules. Their clock generators are no exceptions. They range from the internal clock, which frees I/O pins, to external crystals or oscillators. Once you select the timing source, you have many options for controlling the final bus frequency. For instance, connecting a 32,768-Hz crystal to an MC9S08GB microcontroller allows you to use the FLL (frequency-locked loop) to generate many bus frequencies as high as 18.874 MHz. Selecting the source, the divisors, and the FLL settings allows versatility but also can get complicated.

  Once you write the bus-clock-initialization routine, you may want to verify that the bus is running at the speed you intend before moving on to the rest of the project. This Design Idea presents routines that output a square wave at exactly one-tenth the bus speed on any I/O port (Listing 1 and Listing 2). Just connect a frequency counter to this pin, and it will display your bus frequency. All you have to do is move the decimal point one place to the right. Once you verify the bus speed, you can confidently write the timer, serial-I/O, and other clock-dependent routines.

  You need to write code only to first disable interrupts and disable the COP (common on-chip processor). In your bus-clock-initialization routine, be sure to initialize the I/O port you want to use as an output. Then, just jump to the toggle clock, which outputs the bus frequency divided by 10 until power-down. This Design Idea uses PB0 in the HC08 version (Listing 1) and PD0 in the HCS08 version (Listing 2). You can use any available I/O

port by altering the first line to identify the port and the second line to choose a bit. Also, this Design Idea names ports with the older notation PB, instead of today’s more fashionable PTB.

  Original English URL: http://www.edn.com/article/CA6491147.html

Reference address:Program to directly measure microprocessor bus clock

Previous article:PAC platform provides new measurement and control solutions for the oil and gas industry
Next article:Analysis of load current measurement methods

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号