Flameman/mrm

EARLY PROOF VERSION

= mrm =

i need 74ALVC164245 Integrated Circuit 74ALVC164245

intro
The Mini Robo Mind



The Mini Robo Mind (MRM) is a 68332-powered microcontroller board from www.robominds.com that inspired the founders of this project to create a useful, easy-to-use collection of software libraries. The libraries should serve to make the MRM more accessible to beginners, and improve productivity for experienced embedded developers using the MRM.

The EASy Mind Robot Controller (or Robot Controller for short) contains a small 32 bit microcomputer and a number of peripherals. It is based around the Motorola 68332 microcontroller which forms the central component of a small circuit board called the Mini Robot Mind (MRM) designed by a company called RoboMinds and supplied to us by Competition-Robotics.

The MRM has a maximum speed of 25Mhz and has 512kb of on board RAM plus 512kb of Flash ROM, the flash memory is used to store the programme the computer runs and is designed to retain the contents of its memory even when the power is disconnected. The RAM is used by the programme when the system is running for storing variables and other data. Normally when the power is removed any data stored in RAM will be lost however the MRM has an onboard battery that can preserve the contents if required.

In order to communicate with external devices the MRM uses a number of different 'ports'. The most significant of these is the TPU or Timing Processor Unit. This is actually a second computer or coprocessor built into the Motorola chip. It is designed to perform a number of complex input and output functions, leaving the main processor free to execute the users software without interruptions or delays.

The other I/O ports connected directly to the Motorola Processor are called Port E and Port F. These can both perform digital input and output operations, for example detecting state changes in switches or switching LED's or other peripherals on and off.

In addition to these I/O ports the MRM had an Analogue to Digital converter (A/D) built in. This allows the board to convert analogue signals, for example a signal from a light level sensor, into binary numbers. In the case of the on board A/D converter it has seven channels each with a resolution of 8 Bits. In other words it converts an analogue level into one of 256 numerical values.

Other peripherals built into the MRM include an LCD port for displaying data such as programme variables on a small LCD screen. It also has a number of serial peripheral ports to allow you to communicate with other external devices via a serial bus.

The TPU:

The TPU is the most complex, and useful, part of the controller and as such deserves the most attention. It has 16 channels, which manifest themselves a 16 pins on the MRM. Each one of these can be con figured to perform any one of a number of inbuilt functions to deal with a variety of inputs signals and generate a number of output signals. The channels can also be used in groups to perform other complex functions.

The various functions of the TPU are controlled by setting values in a special part of memory called TPU RAM. As well as storing the configuration settings for each TPU channel it is also used to store any data produced or collected by each channel and to store data for the channel to use, for example a variable from the users programme. The TPU RAM is shared by the main processor and the TPU and is the principal method of communication between the two.

With respect to the way we will be using the board the following are perhaps the most important functions the TPU can perform. Motorola's TPU function data sheet can be found HERE (PDF - 137 KB), and a complete list of Motorola Data sheets for the M68332 can be found HERE

Pulse Width Modulation: [Motorola Data Sheet]

This function is used to generate a Pulse Width Modulated (PWM) signal. This is a digital signal in the sense that it is either 'on' or 'off' but it has what could be regarded as analogue element in that you can alter the amount of time that the signal is on and off (Diagram).

The principal use for this function is for controlling the speed of an electric motor (Link). It can also be used to control the position of servo motor (Link) and in combination with another electronic circuit it can be used as a Digital to Analogue converter(Link).

Frequency Measurement: [Motorola Data Sheet]

The frequency measurement function allows you to measure a stream of digital pulses being sent to the channel and determine their frequency. The frequency is stored in the TPU RAM as a 16 bit number. One use for this function is to create a pseudo A/D converter. With the addition of a Voltage to Frequency Converter (Link) circuit you can present an analogue signal to the TPU as a pulse stream whose frequency will be proportional to the voltage level.

Another use could be to detect the speed of a motor using a simple tachometer. For example you might have a sensor that produces a pulse every time your motor makes one complete revolution so by counting the frequency of the pulses you can work out how fast the motor is spinning.

documentation
* MC68332 Data Sheets * MC68332 Reference Manuals [[Media:mc68332-man.pdf|mc68332-man.pdf]]

Here are the IDs of some of the most important documents:

* MC68332UM/D MC68332 User's Manual * CPU32RM/AD CPU32 Reference Manual * TPURM/AD Time Processor Unit Reference Manual * GPTRM/AD General Purpose Timer Reference Manual * QSMRM/AD Queued Serial Module Reference Manual * SIMRM/AD System Integration Module Reference Manual

gcc&libc porting doc
http://sca.uwaterloo.ca/coldfire/gcc-doc/docs/porting_toc.html

interesting projects

 * 68332 + xilinx fpga http://www.users.qwest.net/~kmaxon/page/cont/cont3.htm
 * 68332 + castelluccio http://svn.dprg.org/repos/dprg/
 * 68332 + retinachip (from gameboy camera) http://www.seattlerobotics.org/Encoder/200205/gbcam.html
 * os robot http://geology.heroy.smu.edu/~dpa-www/robo/subsumption/
 * 68332 robot vhttp://tom-itx.dyndns.org:81/~webpage/maxbot/maxbot_index.php

libraries

 * motorobots, Open Source embedded software libraries for mobile robotics applications, targeting Motorola 68K/ColdFire and PowerPC micros http://www.motorobots.org/

M64282FP CMOS Image Sensor (123x128 array)
This device, which requires only a single 5-volt power supply, has an effective resolution of 128 pixels across by 123 pixels vertically. The M64282FP interfaces with the host micro via an interesting combination of digital and analog I/O. All control and clocking signals are digital, but the intensity of each image pixel is output as an analog voltage. The MRM's built-in fast analog to digital converter is perfect for this application, enabling the sensor to be connected to the MRM with zero "glue" components.

documentation

 * datasheet [[Media:mitsubisci-retina-chip-M64282FP.pdf|mitsubisci-retina-chip-M64282FP.pdf]]

connector.pin 	M64282FP.pin  	 Symbol(s)  	     Function  	                  MRM.pin - 1 	       4,13,15          DVDD,AVDD1,AVDD2    +5V Power Supply 	          Power (+5V) 2 	       1 	         START 	             Start Input 	          Port E Bit 5 3 	       3 	         SIN 	             Data Input 	          Port E Bit 4 4 	       6 	         LOAD 	             Data Set Input 	          Port E Bit 3 5 	       7,9 	         Xrst,RESET 	     System+Memory Reset Input 	  Port E Bit 2 6 	       8 	         Xck 	             System Clock Input 	  Port E Bit 1 7 	       10 	         READ 	             Read Image Output 	          Port E Bit 0 8 	       14 	         Vout 	             Analog Signal Output 	  ADC Port 0 9 	       5,12,16          DGND,AGND1,AGND2    Ground 	                  GND (0V)











void captureButton_actionPerformed(ActionEvent e) {

try { // make sure input buffer is empty while (in.available > 0) in.read; // transmit 'p' command character to take a picture out.write('p'); for (int y = 0; y < 123; y++) { for (int x = 0; x < 128; x++) { int pixel = in.read; if (pixel < 0 || pixel > 255) throw new Exception("Illegal pixel value"); imagePanel.pixels[x][y] = pixel; }     }    } catch (Exception ex) { System.out.println("Exception occurred: " + ex); }   // paint the image imagePanel.repaint; }

void exposureButton_actionPerformed(ActionEvent e) { try { // make sure input buffer is empty while (in.available > 0) in.read; // transmit 's' command character to set exposure out.write('s'); // wait for acknowledgement character in.read; } catch (IOException ex) { System.out.println("Exception occurred: " + ex); } }