Micros Board Notes

 

 

Software:

 

  • The driver for the USB connection on the board can be found here:
  • To set up the driver under Windows XP (should be similar for other versions of Windows)
    • Unzip the file to a directory
    • Plug the board into your computer.  The found new hardware wizard should show up
    • If asked to use Windows Update, select No and Next
    • Choose to install from a specified location and press Next
    • Include the directory where you unzipped the above file to in the search by using the Browse button and press Next
    • The driver should install.
    • Another prompt may come up for more new hardware, if so repeat the above steps.
  • To determine which COM port your board is connected to:
    • Plug in the board
    • Start “Device Manager” (usually found on the Hardware tab of  “System” in the “Control Panel”)
    • Click the Plus sign next to PORTS (COM & LPT)
    • One of the items should be listed as USB Serial Port (COMn) where n is a number.  n is the COM port the board is connected to.

 

  • NITE can be downloaded from here:
  • To correctly set up NITE do the following:
    • Download and copy “nite.exe” somewhere
    • Right click “nite.exe” and select Create Shortcut
    • Right click “Shortcut to nite.exe” and select Properties
    • Change Target to “…\nite.exe -l com3 -f 4 -t 1 -h HOME_DIR” where HOME_DIR is the directory you want NITE to use as its current directory.  Replace com3 with your board’s com port number.
  • If you get an error on start-up saying that the system can’t find the specified file, you may have entered the incorrect COM PORT.  You can test which port it is on by using “:line com?” replacing ? with numbers for the com ports. If the port is not correct, the “not connected” message will appear on the top of the NITE window; otherwise, the information about the connection, such as “line=com3 23040 flow=4 text=1” will be given.
  • If, on startup, NITE gives you messages involving  the keyword “huh”, try changing the target of your shortcut again but type it in rather than copying and pasting from this document
  • You can use help command :h for a list of other available NITE commands.

 

  • HyperTerminal can also be used instead of NITE to download programs to the board.
  • To set up a session for the board:
    • Plug in the board
    • Start HyperTerminal from your Windows Start Menu.  This is part of most Windows installations and can usually be found under Programs…Accessories…Communications.
    • Set up a New Connection called AVR Board
    • Select the COM port of the board as the connection port
    • Set the baud rate to 230400, set flow control to XON/XOFF and  leave other options as default and hit OK
    • You can send .hex files to the board by selecting “Transfer..Send Text File…”.  Make sure you change the search mode to all files.
    • Note that the Nite commands (those starting with colons) are not recognised by HyperTerminal

 

Hardware:

  • The board connectors are split into two rows. 
    • The 2-pin wide row on the top allows connection to the ATMEGA64’s I/O ports.  The two pins for each chip pin are simply shorted together allowing you to connect two outputs from the same pin if you want.
    • The 1-pin wide row on the bottom connects to the various devices on the board.
    • The sets of three pins between the two rows are ground pins.  You can use these for a logic zero if you wish.
  • The devices on the board are from left to right in pin placement:
    • 4x4 Keypad
    • 16x2 LCD Display
    • 10 LED Bargraph Display
    • Audio – Microphone, Filter and Speaker
    • Flash Memory
    • Inputs – Pushbuttons, Potentiometer and Light Dependent Resistor
    • Motor – Voltage Controlled Motor, Strobe LED, Optical Detector and Emitter
  • Bugs
    • PORTE is labelled incorrectly.  The labels PE2-PE7 should actually read PE7-PE2 (the order is reversed)
    • The PORTB pins PB0 and PB1 are easily confused with the pushbutton pins PB0 and PB1.  When you see these in a wiring up example, just think of which one sounds more appropriate
  • Something fun to try
    • Make the following connections:
      • PushButton0 -> OpE
      • PushButton1 -> ASD
      • Pot -> Mot
      • OpD -> Ain
    • Now plug in the board (you just need power, no programming necessary)
    • Turn the POT and the Motor will speed up.  See what happens when you push button 1 while the Motor is spinning

     

    Schematics:

     

    Loader switch/PB0:

    • By looking at the CPU schematic you can find that the loader switch is connected to PB0 (on PORT B) of the AVR.  Therefore you want to be careful not to drive PORTB pin 0 with a value from an external source to avoid conflict.  If this happens, you may not be able to start your program running.
    • For this reason, it is suggested that you only use pin PB0 as an output. 

     

    LCD:

    • The pin connections for the LCD are as follows:
      • D0-D7 – The Data lines as per the Optrex spec.
      • RW – The R/W pin as per the Optrex spec.
      • RS – The RS pin as per the Optrex spec.
      • DS – The E pin as per the Optrex spec.
      • BE – Buffer Enable pin.  This input MUST be logic 0 to operate the board properly.  Make sure your program outputs a logic 0 to the pin, or connect the pin to one of the sets of ground pins located between the two main rows on the board.  Check the IO schematic to find out why.
    • Make sure you control the E input of the LCD as stated in the Optrex spec. section 4.2.  The diagrams here show you how to perform reads and writes correctly.
    • Don’t ignore the fact that you need a delay between sending of all commands.  You have to either wait a decent period of time, or keep reading the busy flag to find out if it is OK to send a command yet.
    • You should use 8-bit operation.  Have the data lines on one port, and the three control pins on another.  Don’t use PORTB as the data port or you will have problems with resetting the board.

     

    Optical Emitter/Detector test

     

    You cannot connect the detector to an LED to test its output as the detector cannot source enough current to turn the LED on.  Try the following to properly test the output of the detector:

    Put the board into Loading mode (This will make PORTA and PORTG inputs which is a requirement for the following to work)
    Connect OpE to pushbutton 0 (simply to provide a logic 1 to turn on the emitter).
    Connect OpD to PA7
    Connect LA7 to a LED
    Connect PG2 to pushbutton 1 (again to provide a logic 1)

     

    The LED will now shine at the full brightness level and show you what the detector is outputting.  When you move the wheel you should see the LED turn off when a hole is present between the emitter and detector and turn on when there is not a hole.  What we have done here is use the buffer that connects the PORT A pins to the LATCH PORT A pins to follow the output of the detector.  This buffer can source a decent amount of current and can drive the LEDs unlike the detector.  PG2 requires a logic 1 to enable the buffer.  Look at the CPU schematic to see these connections.