Microcontroller FAQ - Course Website Directory - University of ...

fiercebunElectronics - Devices

Nov 2, 2013 (3 years and 11 months ago)

60 views


1










Microcontroller FAQ


By


CJ Oster


and


Joseph Ngai




Course Section: H

TA: Paul Leisher

05/06/03

Project #4

ii

ABSTRACT



The goal of our project was to create a large and useful set of documentation on
several of the microcontrollers available

for use in ECE 345 projects.
It is
intended

to be
a
Frequently Asked Questions
,
Getting Started
,
Help I’m Stuck
,

and
Selection
Guide
,
rather than an overly detailed summary of the vendor documentatio
n. We evaluated,
tested, constructed small example cir
cuits, and wrote example programs for four most
widely used microprocessors.

We then put our notes and what we had learned into a
large online documentation forum, designed to give students
all the information
they
would need to choose a microcontroller f
or their project and get started using it.
Each
microcontroller will
has

its

own sections showing initial wiring, how to upload programs,
where to obtain vendor documentation, notes

and troubleshooting
, example programs,
and
from
whe
re to download develop
ment s
oftware.


iii

TABLE OF CONTENTS


PAGE


1.

INTRODUCTION

………………………………………………………..…..…..1

1.1

Purpose

……………………………………………………………………1


2.

DESIGN PROCEDURE

2.1

Researching Available Microcontrollers

…………………………………2

2.2

Reading Vendor Documentation

……………………………………….....2

2.3

Trying

Existing documentation Techniques

……………………………...2

2.4

Reconciling Differences

…………………………………………………..2

2.5

Consolidating Documentation Into a Single Source
………………………2

2.6

Hardware Design

…………………………………………………………2


3.

DESIGN DETAILS

3.1

BaiscX
-
24

………………………………………………………………...4

3.2

M
C68HC912B32

…………………………………………………………4

3.3

XSA
-
100 Prototyping Board

……………………………………………...4

3.4

TMS320C54x

……………………………………………………………..5

3.5

MC68HC912B32 Development Board

…………………………………...5


4.

DESIGN VERIFICTAION

4.1

BaiscX
-
24

………………………………………………………………...7

3.6

MC68HC912B32

………………………
…………………………………7

4.2

XSA
-
100 Prototyping Board

……………………………………………..7

4.3

TMS320C54x

……………………………………………………………..7

4.4

MC68HC912B32 Development Board …………………………………...8


5.

COSTS

……………………………………………………………………………9


6.

CONCLUSIONS

………………………………………………………………..10



REFERENCES

……………………
…………………………………………….11

1

1.

INTRODUCTION


1.1

Purpose


This projects purpose was to make a microcontroller frequently asked questions resource. Its goal was
to gather as much documentation as possible into one place where future ECE 345 Senior Design
students co
uld
quickly and easily reference
. The main goal of the documentation was

to decrease the
time spent

researching and choosing a microcontroller for the student and increasing the time for
constructing and troubleshooting their projects. A website would se
rve the purpose of accumulating all
the information into one consolidated area. Here students would have one place to find out which
commonly used microcontroller would best fit their own projects, the features of each microcontroller,
how to initially wi
re each of these microcontrollers and finally how to work each of them into their
projects.


Also included in our design is a schematic of
the Motorola HC12 in an

expanded memory configuration
.
Similar to the documentation portion of our project, we appro
ached this aspect in a similar fashion

making something that is useful, and would be used. Because of time and parts reasons, we never
physically constructed the board, however a future ECE 345 group might use our design and ideas in
their own project to
build something that the ECE department could use in its teaching endeavors.









2

2.

DESIGN PROCEDURE



2.1

Researching Available Microcontrollers


It was understood that there were a few microcontrollers that were being used in the ECE 345 course.
The m
icrocontrollers were chosen and researched simply by asking the TA what he thought would have
been good choices for this documentation. It was found from previous semesters that the BaiscX
-
24,
MC68HC912B32, and TMS320C54x where commonly used in the course

and that the XSA
-
100
Prototyping board was up and coming seeing that students that have taken ECE 249 will be learning
how to use them and would possibly use them in the ECE 345 course.


2.2

Reading Vendor Documentation


After choosing the four microcontr
ollers that would be documented on the website, the next step would
be to gather information from vendors and other various university resources. It was found that the
BasicX
-
24 from Netmedia and XSA
-
100 from Xess had excellent documentation. For the
MC6
8HC912B32, there was documentation given by the ECE Shop. Finally for the TMS320C54x, the
ECE 320 course website gave documentation after the microcontroller was setup. More will be
explained in the Design Details


2.3

Trying Existing documentation Techn
iques


When finding the documentation that would help in setting up and initially wiring the microcontrollers
so that they co
uld be loaded with programs, it was tested to see if there were any inconsistencies in the
documentation. If there was no problem
getting the microcontroller to load up a simple program, the
documentation techniques were taken and placed on the website with very little modification. If they
were found to be defective
, the correct technique was found and the corrections were made and

readied
to be placed on the website.


2.4

Reconciling Differences


As stated before, if any incorrect techniques were found in the available documentation, as in the HC12
wiring setup, the techniques would be found and corrected then the corrections would

be readied to be
placed in the website.


2.5

Consolidating Documentation Into a Single Source.


After all the techniques were tested and vendor documentation read, they were consolidated in to a
website. This website would store all the documentation tha
t was found and links would be provided to
different sections showing things as how to initially wire the microcontroller, load programs on the
microcontrollers, where to get the development software, notes on problems that we found with the
microcontrolle
r or with the original documentation, and finally a link for the students to see the original
documentation itself.


2.6

Hardware Design


After reading all of the available documentation from Motorola, and basing our design off of a sample
suggested schema
tic, we created a paper
-
design of a full
-
featured development board for the HC12
microcontroller. Our board was designed to make prototyping software much easier than is currently

3

available on the existing HC12 development boards,
with a cost substantiall
y less than commercially
available board

having

similar features.


A full schematic, notes, and design parameters are available in the online documentation portion of our
project, and will be briefly summarized in sections 3.4 and 4.5.


4

3. DESIGN DETAILS



3.1

BaiscX
-
24


Since the BasicX and Basic Stamp family of microcontrollers are widely used, easy to program, and
have many features not found in other microcontrollers, we spent a great deal of time with this
microcontroller. We began by researching all the

available controllers from both Paralax, the makers of
the Basic Stamp, and Netmedia, the makers of the BasicX line of microcontrollers. In our research, we
found that the Basic Stamp is entirely obsoleted by the BasicX, and therefore ceased any further
investigation of the Basic Stamp. However, our online documentation includes a short overview of the
few advantages that can be gained by using the Basic Stamp.


Originally, we had intended to design and construct a full featured development board for the

BasicX,
including a prototyping area, a power supply,
program uploading interface connection,
and protection
circuits for the inputs and outputs of the microcontroller. However, since the BasicX is well designed,
and a serial cable to upload programs can

be easily constructed in less than 10 minutes,
a

more
appropriate use is simply to place it onto one of the prototyping boards available from the

ECE
department. We included very detailed information about constructing a serial cable, pin descriptions,
a
nd notes on connecting external components to this microcontroller in our online documentation, as
well as some example programs Netmedia graciously gave us permission to reproduce.

We also
interfaced the BasicX with a simple LED display, and have include
d the schematic and source code in
our documentation.



3.2

MC68HC912B32


The documentation for the Motorola HC12 was the most problematic. We began by wiring the board in
the manner suggested on the ECE Shop’s documentation page. Following that, we referenc
ed the HC12
Series Technical Documentation and the schematic for the current HC12 board for the correct way to
power and program this CPU.


We then loaded some test programs and consolidated all the available documentation, with corrections,
into our onlin
e documentation. We connected an external clock as an input to this CPU and the same
LED display we used for the BasicX to demonstrate how to receive inputs and produce outputs using
this microcontroller.


A large portion of our online documentation inclu
des all of our notes on the expanded memory
configuration we used as our hardware design portion. Since this is easily the most widely used
microcontroller, we hope our thourough explanation of the external memory operations and schematics
will be extreme
ly useful and time
-
saving to any student who wishes to use this microcontroller with
external memory
. As was our original intent, a future ECE 345 group can physically construct our
development board and create a valuable tool for the ECE Department.



3.
2

XSA
-
100 Prototyping Board


The XSA
-
100 was fairly easy to design and implement, though it is hard to learn to program in VDVL
there is a steep learning curve. But, students who have taken ECE 249 would have prior experience and
would not have much troub
le getting this microcontroller working.



5

3.3

TMS320C54x



For the TMS320C54x
,

we

created
a working low
-
pass filter
to demonstrate the microprocessor’s ability
to
process signals digitally
. It was found that
this

microprocessor
is

well documented on the E
CE 320
websi
te for that specific lab course, h
owever the website assumes that the microprocessor has been
properly set up and that the TMS320C54x works flawlessly.
The documentation

would not be any help
for future ECE 345 students to get it working if t
hey did not have a prior knowledge of it or if they have
taken the ECE 320 course itself. Even if the students had taken
ECE 320,

they would have to start from
the very beginning and manually setup the DSP in the ECE 345 lab. There, every student
,

whethe
r they
have taken the ECE 320 lab course or not would have trouble.


It was found that Code Composer requires a precise setup or it will give many errors that are hard to
decipher with out prior knowledge of the setup process. Manually setting up the mi
croprocessor
requires the correct drivers, the correct TI libraries and obviously a copy of Code Composer Studio
itself. Code Composer Studio is rather expensive starting at $495
-

$600 just for an annual subscription.
It is highly improbably a student w
ould purchase such software and is unexpected, because the ECE
department owns a license. It is highly recommended that setup be left up to Joshua Potts or Andrew
Assad, the lab software technicians to the ECE 345 lab. They will install Code Composer and

have the
correct setting
s

and the correct TI libraries installed so that Code Composer can talk

to,

and upload
programs to the TMS320C54x. Then it is up to the students to get the DSP physically working and
talking to Code Composer. This should be relat
ively easy and is explained in the
online documentation
thoroughly
.



3.4

HC12 Development Board


We were asked by our teaching assistant to design a full
-
featured development board the department
would be able to use in ECE 345 as well as other classes.
Looking back at past projects, we found that
the Motorola HC12 microcontroller is both widely used and very powerful, but documentation and
features are sketchy at best. Also problemat
ic with the current HC12 board is its inferior programming
interface, l
imited memory, and the inability to store large programs in its flash
-
memory without
overwriting the boot
-
loader and debugging software already on the CPU.


We began our design by studying a suggested schematic found in the Motorola HC12 Series Technical
D
ocumentation of a CPU with an expanded, 8
-
bit wide external memory bus. Included in this schematic
are some features we felt should be included in our design, as well as some ideas and clarifications about
the details on the operation of an external memor
y bus.


From Motorola’s example schematic, we kept a protection feature that resets the CPU if the input
voltage falls below a point at which improper CPU operation can occur. Also included is a
programming and debugging interface which is entirely supe
rior to the serial boot
-
loader that now
exists, while still keeping the ability to use the serial boot
-
loader if a user determines it as the best route.
Separate on
-
chip hardware called the Background Debug Module allows for program uploads and run
-
time d
ebugging; however the interface cables and the software for this are rather expensive. Perhaps a
future ECE 345 group can construct these cables and write the software to support the background
debug hardware and make this CPU an extremely useful tool for

other ECE 345 students as well as other
courses at this and other universities.


We improved
Motorola’s example schematic
by adding more memory and a 16
-
bit wide bus that allows
double
-
word memory transfers in a
single cycle. The example schematic also d
id not utilize all of the
available memory in the external memory chips and leaves portions of the CPU’s memory map still un
-

6

mapped. Our design makes the entire 64Kb memory space of the CPU usable or program or data
storage. While we designed the board t
o use battery
-
backed static RAM modules so that programs will
remain stored after a power failure, a simple modification to our schematic would support external ROM
chips

for inclusion in an embedded CPU environment. We also integrated a user
-
selectable c
lock
frequency in the event that memory chips are used that cannot support the full bus speed of the CPU.


Finally, while we were unable to work out the details, we included in the online documentation some
ideas about making a user
-
configurable board. Th
e setup includes a CPU module with all necessary
hardware to run the microcontroller in single
-
chip mode, and stackable modules with narrow or wide
memory expansion busses, ROM sockets, or real
-
time digital signal processing hardware to name a few.

Please

see the electronic documentation for all of the details.

7


4. DESIGN VERIFICTAION



4.1

BaiscX
-
24


We had very few problems using this microcontroller since it is extremely well documented by the
manufacturer. One of the most valuable tools we designed w
as a simple serial cable to upload programs
to this chip while it is on a standard prototyping board to eliminate the need to purchase the development
system from the manufacturer.


Since the BasicX is a TTL compatible microcontroller, we also had no probl
ems connecting external
hardware to it, except for the fact that unconnected inputs have rather sporadic results. A simple fix is to
use pull
-
up resistors to drive inputs high or low as required.


Our final demonstration circuit used the CPU’s internal ti
mer to increment a counter and display the
contents of the counter on an external LED display. We also used an output of the BasicX to drive one
of the inputs on the HC12 to show that the two microcontrollers can be easily connected together with
some sup
porting hardware. Everything worked as planned and intended; we had no problems following
our own instructions to wire a functional circuit on the first attempt.



4.2

MC68HC912B32


There was a problem with wiring the module as it was found that the docum
entation from ECE Shop
was in error. It stated that a few pins were interconnected on the module itself, when in fact the pins
needed to be individually connected.


The final for this microcontroller, the same type of program was used to verify the docume
ntation and
the module worked. A LED display very much like the BasicX
-
24 and the HC12 was used to count
from 0 to 9.

It used a CMOS buffer was used to connect the module to TTL chips that would run the
LED display, since the HC12 is CMOS compatiable.


4
.3

XSA
-
100 Prototyping Board


The final demonstration was a

program from a ECE 249 lab was used to display the PS/2 capabilities of
the XSA
-
100 using a ordinary computer keyboard and the
7 segment display
.

There were

no problems
with verifying that the FP
GA board worked. The simple keyboard

program loaded and executed
flawlessly.



4.4

TMS320C54x


There were no problems verifying that the TMS32054x worked. The low pass filter code taken from lab
0 of the ECE 320 lab course worked well in demonstrating the DS
P capabilities of the microprocessor.
The filter filtered out higher freque
ncy signals and cut out at the N
yquist rate









(1
)



8

The
directions on the documentation website were

used to setup this microprocessor to see if the
doc
umentation itself could be understood and was complete in explaining how to upload programs to the
TMS320C54x. After the problems with setting up the microcontroller with Code composer where taken
care of with the correct installation of the drivers and l
ibraries and setup of Code Composer, the
microprocessor worked flawlessly.



4.5

HC12 Development Board


The primary issue with an expanded memory configuration and the Motorola HC12 is the cycle time.
Motorola discourages external memory connections at f
ull clock speed, but we decided this is a
significantly smaller problem today than when Motorola’s documentation was written. At full clock
speed, 8 MHz, the read and write cycles on the external memory must both occur in less than 125ns. In
our research
, we found that memory and the supporting hardware are readily available to me
et this
requirement. This is, however, the reason we included a user selectable clock frequency of 1, 2, 4,
or

8
MHz.


9


5. COSTS


Our actual costs were generally small. For ou
r example circuits, we purchased the needed hardware for
less than $10. All of the microcontrollers were borrowed from the ECE Department; with the exception
of the BasicX we used, which Mr. Oster already had in is personal collection. The largest portio
n of our
costs went to the prototyping of the expanded memory HC12 CPU, and of that, it was almost all the
RAM modules, which cost about $17 each. Other supporting hardware for the HC12 was less than $5.
Our total costs for the project, excluding labor,
was about $70.


10

6. CONCLUSIONS



Looking back on our project, we should have chosen fewer microcontrollers on which to focus. This
would have allowed us to put together even better documentation, as well as some better work on the
development board we de
signed. The Texas Instruments DSP board is not widely used, and the XESS
FPGA board is used even less, so it might have been appropriate to focus all of our time on the HC12
and the BasicX. We are, nonetheless, very pleased with the outcome of our projec
t and hope it serves its
intended purpose as a widely used reference by other students to shorten

their research. It has been a
privilege to create a needed resource for other students and the ECE Department.

11


REFERENCES


[1] Netmedia, Basic Express BXK24

Developer Kit, 2002


[2] Electronics Services Shop


Available Modules, University of Illinois at Urbana Champaign,
http://www.ece.uiuc.edu/eshop/availablemodules/


[3] Xess Corporation, XSA Board V1.1, V1.2 User Manual, May 6, 2002,
http://www.xess.com/m
anuals/xsa
-
manual
-
v1_2.pdf


[4] ECE 320


Digital Signal Processing Laboratory, University of Illinois at Urbana
-
Champaign,
http://www.ews.uiuc.edu/~ece320/


[5] efunda, Engineering Fundamentals, 2003,
http://www.efunda.com/designstandards/sensors/methods
/DSP_nyquist.cfm