Thursday, October 13, 2011

C167 Microcontroller Basics- Components and Design process

1. The Brains

I already explain the brains of the robot to be a controller, in other words, a microprocessor. Hold on! Don’t start thinking Gigahertz processors! A 20 MHz processor would suffice! In your case, it is the Infineon C167CR-LM (henceforth referred to as the C167). 

2. What is the C167?
Glad you asked! Figure 1 shows the location of the microcontroller on the KitCON-167 board from Phytec (more on this board later). You can open your CalBOT kit and examine this board as you read this article. Don’t worry if your board is not all wired up like mine.


Figure 1. The actual C167CR-LM on my board.

The C167 is a microcontroller, it is used to control (makes sense!) some process or aspect of the environment. Just like the more popular microprocessor (the Intel Pentium or the AMD Athlon), a microcontroller has a lot of stuff built into it – o n-chip memory, an Arithmetic Logic Unit (ALU) etc. However, unlike the Pentium a microcontroller is not optimized for building PCs or laptops. For instance, the maximum clock speed of your C167 is 20 MHz. The latest Pentiums on the other hand have clock speeds in the Gigahertz range. But this speed is required only for computationally intensive software. The software controlling your CalBOT is not that complex. 20 MHz is a very fast clock speed for a microcontroller.

Clock speed is not the only area where microcontrollers differ from microprocessors. The C167 has other components suited for control that are built onchip, which the Pentium does not have. Examples include Analog-to-Digital converter (A/D module), the ASC0 (Asynchronous serial transmitter) and the PWM (Pulse Width Modulation unit). Of these modules, only the PWM is covered in detail in this manual.The reason is twofold: you only need to understand the PWM module to complete the basic CalBOT and more importantly, to avoid repetition. Once you understand one module, it is a simple matter to look up how the other modules work and then use them. 

Just like you need a motherboard to build a computer, the C167 needs a target board so its potential can be fully realized. We use the KitCON-167, this is the board on which the C167 is mounted. Figure 2 shows the different parts of the KitCON-167.
Figure 2. The most important components of the KitCON-167. The rectangles associate the description with the components.

Of the components shown in figure 2, you need to be familiar only with the KitCON connector to complete the CalBOT. You don’t need to understand the details of voltage regulation, RS-232 protocols or the memory architecture!

3.  Using the C167
Using the C167 (or any microcontroller) is mainly a four-step process.  First, you program the module you want (for instance, the PWM).  Then you download this code to the on-board RAM.  You test your code.  If there is an error, you start the debugging process.  Once you are satisfied your C167 is doing what yo u want, you have the option of burning your code to FLASH so your code is retained even when you turn off the power.  Figure 3 summarizes the build process.  We will expand upon these steps in greater detail as we move along in the manual.  However, burning code to onboard FLASH is not covered in this manual.
Figure 3.  The design process

No comments:

Post a Comment