advanced micromouse hardware design. lecture outline microcontroller power system peripherals sensor...

26
Lecture 4 Advanced Micromouse Hardware Design

Upload: sybil-sherman

Post on 18-Dec-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

Lecture 4Advanced Micromouse

Hardware Design

Lecture OutlineMicrocontrollerPower SystemPeripherals

Sensor System: IR emitters and receiversMotor ControllerGyroBuzzerDisplayVoltage MeterLEDsPush ButtonReset Button

MicrocontrollerSTM32F405RGT6 – 64 pins

Timers - Generate PWM signals to motor, buzzer

GPIOs – LEDs, IR emitters, push buttonUSART – Allows “printf” to display on a

terminal SPI – Prints data on alphanumeric displayADC – Convert analog voltage to a digital

number 1 MB Flash – Store maze info

Microcontroller PinsMulti-function pins

Power System - Microcontroller Power Supply Schemes:

VDD = 1.8 to 3.6 V: external power supply that will supply the voltage for GPIOs (Futura Mouse: 3.3 V)

VDDA = 1.8 to 3.6 V: external analog power supply for ADC, DAC, Reset blocks, RCs and PLL (Futura Mouse: 3.3 V)

VBAT = 1.65 to 3.6 V: power supply for RTC, external 32 kHz oscillator, backup registers (Futura Mouse: 3.3 V)

VSSA = GND for VDDA; VSS = GND for VDD

VCAP: connect 2.2 microFarad ceramic cap between this pin and GND (External capacitor that decouple power supply)

Power System

Power System – Power SupplyFully Charged Battery: 8.4 V (2 x 4.2 V)

Motor Controller System (Level shifter + H-Bridge)5V regulator

5V Encoders, IR Emitters (anode “+”), Alphanumeric

Display3.3 V regulator

3.3 V Microcontroller, Buzzer, USART, push buttons

3.3 VA (analog circuits) IR Receivers, Gyro

8.4V Power - Battery

Power 5V

Power 3.3V and 3.3VA

IR Emitter - Front(SFH4545)

IR Emitter – DiagonalSFH4545

IR Receiver(TEFT4300)

IR Sensor Pulsing Timing

Delay between each sensor reading until all residues are gone

Motor Driver

Level Shifter IC

H-Bridge IC

Gyro

Buzzer

- Buzzer behaves like an inductor- Diode is used to prevent inductive kickback

Display

Voltage Meter

Keep track of the battery voltage to protect the battery from over discharging

LED2 ways to control LED

with MCUThe one on left is easier

for wiring since ground is easier to find

The way to the right is better in terms of power, since power is not drawn from the MCU

Futura Mouse uses left scheme

Push Button-Futura Mouse uses right scheme

Boot0 ButtonFor new MCUs,

bootloading must be done just once via USART

Boot mode must be entered first before bootloading

Figure 2 shows how to save one button

Figure 2

Figure 1

System memory boot mode- Bootloader is stored in the system memory (ROM).- To enter boot mode, set Boot0 high by holding down on the Boot0 push button, then push the reset button. Boot1 should be connected to GND.- Using USART, load application programs into FLASH.

Boot0 and Boot1

Reset ButtonUse Reset to reset the

state of the mouse, instead of the power ON/OFF switch

This button is IMPORTANT for entering system memory boot mode

Reset is active low

References http://

www.st.com/web/en/resource/technical/document/datasheet/DM00037051.pdf

STM32F405 MCU datasheet

http://www.seattlerobotics.org/encoder/mar97/basics.html Info about pull-up and pull-down resistors

http://coactionos.com/embedded%20design%20tips/2013/10/21/Tips-Understanding-Microcontroller-Pin-Input-Output-Modes/

Info about pin input/output modes (i.e. push-pull, open-drain) http://www.allaboutcircuits.com/vol_3/chpt_3/9.html

Info about inductive kickback https://learn.sparkfun.com/tutorials/capacitors/application-examples

Info about decoupling capacitors (filters) http://learn.parallax.com/node/258

Info about phototransistor circuits (IR receiver)