Friday, December 23, 2011

Arduino Mini Pro Testing


Setup Arduino Pro Mini

Soldered a right angle header on the serial connection side of the Arduino Pro Mini (3.3V) which allowed connection of the Sparkfun FDTI Basic (3.3V) board. Downloaded the Arduino software for Windows (using WinXP) and installed. Connected the FDTI Basic board to computer via the USB cable. Ardunio appears to be powered.

For the 3.3V versions of the Arduino Pro Mini:
Tools > Board menu
Select Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ATmega328

Arduino Pro Mini Tutorial:
http://www.sparkfun.com/tutorials/244

Arduino Pro Mini Schematic:
http://www.sparkfun.com/datasheets/DevTools/Arduino/Arduino-Pro-Mini_328-v11.pdf

Pinouts from schematic


Blk Side (JP7)
12 TX0
11 RXI
10 RST
9 GND
8 Digital 2
7 Digital 3
6 Digital 4
5 Digital 5
4 Digital 6
3 Digital 7
2 Digital 8
1 Digital 9

Grn Side (JP6)
1 Raw voltage input
2 GND
3 Reset
4 VCC
5 Analog 3
6 Analog 2
7 Analog 1
8 Analog 0
9 SCK
10 MISO
11 MOSI
12 Digital 10

Center (JP2)
1 Analog 4 - SDA
2 Analog 5 - SCL

Program Testing

Sample Program from Arduino examples/1.Basics folder
Blink.ino

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}

void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(200); // wait for a second

}


Power Connection to CEENBoT

Breakout board V1.00 to Arduino Pro Mini
GND and 3.3V pins to GRN (JP6) GND (2) and VCC (4)

Sunday, September 18, 2011

AVRISP mkII Status Light Flashing or Blinking Red and Orange

A couple students were using the AVRISP mkII to program a CEENBoT. They were using AVR Studio 4 and when they connected to the programmer, AVR Studio 4 asked them to upgrade the programmer. They started the upgrade process, but it did not finish completely. The AVRISP mkII was left in the upgrade mode and the status light at the ISP cable end was blinking between red and orange.

The fix for this is in the AVRISP mkII User Guide on the Atmel website.
Web search and download: AVRISP mkII User Guide

In the User Guide under Hardware Description they provide a table of status lights and what each light means including the blinking red and orange, which means the device is in upgrade mode.

In the Manual Firmware Upgrade section they provide the steps required to complete the upgrade of firmware. You have to open the AVRISP mkII plastic case, use a paperclip to jumper across holes 1 and 3 on the circuit board, then use AVR Studio 4 > Tools Menu > Upgrade AVRISP mkII to complete the upgrade. Remove the jumper, close the plastic case, power cycle the AVRISP mkII, and you are back in business.

Sunday, August 14, 2011

Using the Adafruit USBtinyISP

The new CEENBoT Commander uses an open source AVR mkII ISP driver that is not compatible with the regular AVR driver. When you try to run both the new CEENBoT Commander and AVR Studio 4 on the same computer, the AVR proprietary driver will load and CEENBoT Commander will not be able to program the CEENBoT. When you have both CEENBoT Commander and AVR Studio 4 installed on a computer you will need to use AVR Studio 4 to send the programs to the robot.

Well I figured that if I have to use AVR Studio 4 anyway, I might as well use the Adafruit USBtinyISP. I had built one of these kits earlier and had gotten it to work using directions from the USBtinyISP page. I used the Windows directions here.

It is really not too bad leaving CEENBoT Commander to go over to AVR Studio 4 to upload programs. And when I want to program the CEENBoT with the API using C, I can do that too using the USBtinyISP.

The next generation of CEENBoT will have the ISP programmer built in and accessible through a USB cable. So eventually the ISP programmer will not be needed anyway.

Connecting using USBtinyISP


Setup USBtinyISP Programmer
Install drivers and check that the USBtinyISP appears in the Windows device manager

Setup a COM bridge (COM2 <> COM6)
Install com0com bridge (Unclick the CNCA0<>CNCB0 checkbox during install)
Check Windows device manager for COM ports in use
Use com0com bridge command: install PortName=COM2 PortName=COM6
Windows will setup the ports (Answer No, do not search Internet, then Install automatically)
Device manager should now show the ports

Setup USBtiny500 Emulator
Install the software and run USBtiny500
Select one of the ports for the USBtiny500 emulator like COM2
Once the port is selected the USBtiny500 emulator will look for a USBtiny
The other port will be used in AVR Studio for the programmer: STK500 on COM6
The USBtiny should be found on a USB port, USBtiny500 should show: Status: Ready
If it fails to find the USBtiny on a USB port, unplug and reconnect the USBtiny interface

Setup the AVR Programmer in AVR Studio 4
Use Tools menu > Program AVR > Connect (or use Con button on toolbar)
Select Platform: STK500 and Port COM6

Verify AVR Programmer Setup by Connecting to CEENBot
Use Tools menu > Program AVR > Auto Connect (or use AVR button on toolbar)
Click Cancel if an upgrade warning message box is desplayed

Turn on CEENBoT
Connect ISP cable (6 pin)  to ISP port on CEENBoT, match the red stripe with pin 1
Under the Main tab select device: ATmega324P and Programming Mode: ISP mode
Click Read Signature button to check the connectivity to the CEENBoT
The Read Signature button may need to be clicked a few times to get the proper reading
The USB connection to the computer may need to be unplugged and reconnected
The signature returned should match selected device: ATmega324P

Wednesday, August 3, 2011

Spiral Turns

Can you derive the expression for turning radius when a the wheels of a two wheeled robot are operating at different speeds?

The resulting formula is a rational fraction of the form:
R = d * V1 / (V2 - V1)
where R is the radius of the turn d is the distance between the wheels, and V1 and V2 are the speeds of the wheels, with V1 < V2.

Is this formula correct?

Programming could use TI-BASIC input statements to enter speeds for each wheel.

Challenge - the Fibonacci spiral, constructing a spiral, other spirals

My First Posting

Hello World!!