DOC PREVIEW
USC EE 459Lx - MC908JL16

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Ming Hsieh Department of Electrical EngineeringEE 459Lx - Embedded Systems Design LaboratoryThe Freescale MC908JL16 Microcontrollerby Allan G. Weber1 IntroductionThe Freescale MC908JL16 (also called the MC68HC908JL16) is one member of the HC08 microcontrollerfamily. Each member of the family has different amounts of RAM, ROM, I/O ports, etc. Depending on thenumber of external pins required they may come in packages with more than a hundred pins, or with as fewas eight. The MC908JL16 was selected for the EE 459 class for a variety of reasons:• Availability of both the chips and a development system from a vendor.• Available in 28-pin DIP (dual-inline package) that fits into available IC sockets.• Enough TTL compatible I/O pins (22) to handle most EE 459L project tasks.• FLASH memory for easy and fast reprogramming.The following notes are meant as a short guide to getting started using the JL16. Additional documentson the EE 459 web site describe using the C and assembly language software development systems. For morecomplete information on any of the topics below, see the full Freescale datasheet or programming manual.2 HardwareThe MC908JL16 contains the following components:• 16kb of FLASH memory for program storage.• 512 bytes of RAM memory.• Two 16-bit timers. These can count internal clock cycles or external events and generate an interruptwhen reaching a specified count value.• 12 channels of 10-bit analog-to-digital converter (ADC).• Serial communications port. This can be used to communicate to the COM port of a computer.• I2C interface port for communication with other I2C compatible ICs• 22 lines of general purpose I/O. Some of these have special capabilities for driving things like LEDs.Not all of these functions are available at the same time. Most of the pins on the chip are connected tomultiple functional units and it is up to the designer to decide what a particular pin does. For example, a pinmight be use as a general purpose I/O line, or it might be ADC input, but it can’t be both simultaneously.2.1 Minimum ConnectionsIn order to make the microcontroller operate the following connections must be made.EE 459Lx, Rev. 1/14/13 12.1.1 Power and GroundThe power supply voltage (5 volts) must be connected to the VDD input on pin 7. The ground connection(VSS) is on pin 3.2.1.2 ClockSome sort of clock signal must be provided in order for the microcontroller to operate. On the MC908JL16the clock can come from one of three different sources.A TTL-compatible clock signal can be generated externally by other logic and connected to the OSC1input (pin 4.) This probably the easiest way to generate the clock for the EE 459 projects. The lab has asupply of DIP oscillators in some of the more common frequencies. These output a TTL level square wavethat can be fed directly into the microcontroller and to other chips. If this method of providing a clock isused, the OSC2 output (pin 5) must be left open and functions that are available from pin 5 in other modes,such as Port A bit 6 (PTA6) are not available in this mode.Alternatively, the processor can generate a clock if a crystal is connected to the OSC1 and OSC2 inputs.This method uses a plain crystal, not the DIP crystal oscillators as described above.The third method uses an RC circuit connected to OSC1 input (pin 4.) The time constant of the RCcircuit determines the frequency of the clock. This is the least accurate way to generate a clock and in mostcases it would be difficult to have the clock frequency within 10% of the desired frequency. Do not use thismethod if your project requires a clock running close to a specified frequency. The advantage of the RCclock mode is that other functions are now available on pin 5. For example it can now be used as Port Abit 6 (PTA6) thus giving the microcontroller 23 I/O pins. In order to use the RC mode, the OSCSEL bitin the Mask Option Register (MOR) must be programmed to a zero when programming the chip. See thedatasheet for more information on using the RC clocking mode.However the clock signal is provided, it is divided by four internally before reaching the processor. Thismust be taken into account when calculating the execution time of instructions for delay loops. For example,a 12MHz clock signal into OSC1 will result in an internal clock rate of 3MHz, and a 333ns period for eachinstruction clock cycle. The internal clock is referred to as the “internal bus clock” in the documentation.In applications where the SCI (Serial Communications Interface) capabilities of the MC908JL16 are beingused, the choice of clock frequency determines the baud rates that can be used for transmitting and receivingserial data. In most applications, the requirement to support a particular baud rate will determine whatclock rates can be used. See Sec. 2.4 for more information.2.1.3 Reset and InterruptThe reset input (RST, pin 28) and the interrupt input (IRQ, pin 1) must be in the high state for the processorto operate normally. Both of these pins have internal pull-ups and can be left unconnected if they are notbeing used. The pins do not have to be externally pulled-up to VDD in order for the processor to operatenormally.2.2 I/O PortsThe MC908JL16 has 22 pins that can be configured for general purpose I/O. Many of these can also be usedfor other purposes such as analog-to-digital conversion, timers, etc. Each port has a corresponding DataDirection Register that is used to determine whether the pins for that port are serving as inputs or outputs.Initially, or upon a reset signal, the bits in the DDRs are all zero which makes the corresponding I/O portbits inputs. To use a I/O port bit as an output, the corresponding bit in the DDR must be set to a one.Each of the three ports are slightly different and it is important to carefully read the datasheet to determinehow to use each port.2.2.1 Port A (PTA)Port A on the MC908JL16 has six pins (PTA0 through PTA5). A seventh bit, PTA6, is described in themanual but is only available when the RC clock mode is used. It is NOT available when using a DIPEE 459Lx, Rev. 1/14/13 2oscillator or TTL signal to provide the clock. Each bit in PTA has a software configurable pull-up resistorthat can be used if the bit is an input. These are controlled by bits in the PTAPUE register. Each of thebits PTA0-PTA5 are capable of sinking sufficient current (max. 25mA) to directly drive LEDs.2.2.2 Port B (PTB)Port B on the JL16 has eight pins (PTB0 through


View Full Document

USC EE 459Lx - MC908JL16

Download MC908JL16
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view MC908JL16 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view MC908JL16 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?