Show Posts
Pages: 1 [2] 3 4
16  Using Arduino / Displays / Re: Shift Register Libraries for LCD Displays on: April 12, 2012, 08:40:49 am
I also use the IDE v1.0 although these days I mostly use make for my compilations. I use the same LCD display as you.

I am not sure if I can help much as I haven't used this circuit with an actual Arduino for quite a while. I have moved on to using bare-chip AVR ATtiny85 and ATtiny84 designs. There  is a video of my ATtiny85 version at http://youtu.be/9r2GVga5cYs

I can say that without the bypass capacitors the circuit was unreliable, displaying random garbage, as you are experiencing. I could tell that the firmware was sane because I could send serial commands to the circuit to turn the LED on and off. Inserting bypass capacitors solved my reliability issues. If you insert bypass capacitors and still have reliability issues you may have power supply noise. Finally, substitute different physical ICs and display in case you have a chip problem.

Two pieces of advice that I have learned the hard way on this project. (1) If you use one of the ATtiny chips, pay attention to the core's pin assignments. There are several ATtiny cores out there and they differ. I use MIT's Arduino-Tiny core; (2) If you use a serial connection that uses a CP2102 I/O chip, isolate the Rx line (CP2102's Tx, your board's Rx) with a signal diode. Otherwise your circuit will lockup if connected during power-on - or appears to lockup as the LCD displays the same pattern as if no CPU were present. Oddly, if connected after power on it worked correctly. Anyway, diode isolation solved that issue.
17  Using Arduino / Programming Questions / Re: Auto Detect Baud Rate on: March 29, 2012, 10:10:31 am
One option is to connect the GPS directly to a serial port on your computer and capture the initial character after a known operation, such as GPS power cycle, reset, or some other easy function. Then, use the above mentioned bit timing on the, now, known first character. This method is limited to that specific GPS but you didn't indicate that you wanted a universal method, which is, obviously, harder as you don't know what data is being sent. That said, however, a universal method would be to assume that there is a quiet period between data - reasonable with a stationary GPS, and time for the shortest start bit only. A start bit followed by a "high" in data bit zero. would be what you would time for. Hopefully some character in a stream will have this case and all data will not have a "low" in data bit zero. You would time some quantity of characters, only evaluating the time of the initial start bit. Each character ends with a stop of two "high" bits, so a continuous stream of data will always have a "low" start bit following two "high" bits.

8051 assembly code at the link below provides a similar method, in this case measuring the character length:
 http://www.programmersheaven.com/download/3733/1/ZipView.aspx

This may help:
Code:
/* Determine the baud rate to operate at by getting characters until
we find something recognizable. Return with the global 'rate' set and
Novation type modems put in transparent mode. The initial delay is because
the answer modem returns connect info much earlier than the originate. */

connect() {

unsigned n;

        delay(100);                    /* delay */
        flush(1);                            /* flush garbage */
        cd_flag= 0;                    /* watch carrier */

        while (1) {
                rate= 300;
                baud(rate);               /* test at 300 baud */
                n= mrconin();         /* get a raw key */

/* At 1200 and above, one byte (CR or anything) fits into 1/4th a character,
so the rest of it is ones. If we find f0h, try more or less the same thing
as the 300 vs. 600 case, but at 1200 baud. */

                if ((n & 0xf0) == 0xf0) {
                        rate= 1200;
                        baud(rate);
                        n= mrconin();      /* RAW Modem conin() */
                        if ((n & 0x7f) == CR) break;
                        if ((n & 0x7f) == ' ') break;
                        if ((n & 0xf0) == 0xf0) {
                                rate= 2400;
                                baud(rate);
                                break;
                        }

/* For 300 baud, we should get a CR. If so, get another to make sure. It
might have been garbage or a leftover result code. Baud rate is already
set to 300. */

                } else {
                        n= mrconin();
                        if ((n & 0x7f) == CR) break;
                        if ((n & 0x7f) == ' ') break;
                }

/* None of the above. Now we need to flush before we try again, as we
somehow might have ended up receiving 300 baud chars at 1200, and that
generates multiple garbage bytes. */

                flush(5);                     /* 50 mS quiet, flush garbage */
        }

/* All set. Put Novation modems to sleep, and flush the software ring buffer
and things. */

        if (mdmtype == SMARTCAT) atp("\016U 0",CR);
        if (mdmtype == IBMJR) atp("\016T 0",CR);
        if ((mdmtype == IBMJR) || (mdmtype == SMARTCAT)) delay(100);
        mconflush();
}
 
18  Using Arduino / Displays / Re: Shift Register Libraries for LCD Displays on: March 08, 2012, 07:04:23 pm
Yes, you can use multiple power supplies, connecting the common, within reason. The Vcc should be as close to the same as you can get it, given that there will be some feedback through circuit connections, such as the Atmel chip, i/o chips, etc.
19  Using Arduino / Displays / Re: Shift Register Libraries for LCD Displays on: March 08, 2012, 10:19:02 am
Consider getting a breadboard specific power supply, such as this: http://tinyurl.com/85avtt2

They are under $5 and perfect for Arduino breadboard work, specifically designed for the type of breadboard shown in your Fritzing image. You'll also need a 6-to-9 volt wall wart transformer - maybe hiding in your closet or at the local thrift store.

20  Using Arduino / Displays / Re: Shift Register Libraries for LCD Displays on: March 07, 2012, 09:18:31 am
LiquidCrystal_SR from New-LiquidCrystal is the best library choice.
Get it directly from the author: https://bitbucket.org/fmalpartida/new-liquidcrystal/overview

Other good reading: http://code.google.com/p/arduinoshiftreglcd/ - contains important info regarding the circuit design.

and, yet more: http://www.3guys1laser.com/blog-cheap-arduino-2-wire-lcd-display-0

21  Using Arduino / Interfacing w/ Software on the Computer / Re: Cheap Serial Interface on: March 02, 2012, 08:29:52 pm
I also have their USBasp - works great! I have only used it for programming ATtiny85 but it has been flawless - and dirt cheap. The logo is not present on my USBasp. Instead they have their website www.betemcu.cn and some Chinese characters.
22  Using Arduino / Interfacing w/ Software on the Computer / Cheap Serial Interface on: March 02, 2012, 06:34:38 pm
I just recently purchased, on eBay, a couple of inexpensive serial interfaces that work well and cost me $2.93 each, including postage. They are designed for 3.3V logic but they use a CP2102 IC that is 5-Volt tolerant so they also work in 3.3-Volt or 5-Volt circuits. An irritation is that the Tx and Rx lines are labeled backwards on the silk screen labels to accepted practice. To order one just search for "USB 2.0 to UART TTL 6PIN Module Serial Converter CP2102" on eBay. There are several versions on eBay. The ones that I purchased are made by http://www.betemcu.cn and the logo on the board looks like "BA\TE". See attached photo. They have a full-size USB port on one end and pins on the other. You'll probably need a USB extender cable to use it (male/female) - at least I needed one.
23  Using Arduino / Microcontrollers / Re: USBasp burns attiny85 from CLI but Arduino IDE fails on: February 21, 2012, 07:02:43 pm
[SOLVED] - I feel pretty stupid. I was clicking the UPLOAD button (right arrow) rather than using the drop-down menu File->Upload_Using_Programmer. Programming a ATtiny85 works correctly from within the Arduino IDE if using the drop-down menu File->Upload_Using_Programmer.

The cryptic Java messages led me on a merry wild goose chase.
24  Using Arduino / Microcontrollers / Re: USBasp burns attiny85 from CLI but Arduino IDE fails on: February 21, 2012, 04:01:49 pm
re - "There must be something in your files that offends java"  - Googling around indicates that the likely cause is Arduino's java code is finding a NULL entry for something that it is looking for in either boards.txt or programmers.txt. I have wondered it it is looking in the ~/arduino/arduino-1.0/sketchbook/hardware/attiny/boards.txt when it is getting things right but somehow reverting to the ~/arduino/arduino-1.0/hardware/arduino/boards.txt file when the java fails - an artifact bug from pre-version 0018 java that didn't look under "sketchbook/hardware" for a boards.txt, perhaps.

My other question is - is there anyone that successfully uses a usbasp programmer from with the Arduino IDE for ATtiny chips?

25  Using Arduino / Microcontrollers / Re: USBasp burns attiny85 from CLI but Arduino IDE fails on: February 21, 2012, 03:29:12 pm
The parameter 'upload.using' was just an artifact of my trying different things. Removing it makes no improvement - I still get the same java errors.

The usbasp programmer was selected from the drop-down menu in every case that it was used.
26  Using Arduino / Microcontrollers / [SOLVED] USBasp burns attiny85 from CLI but Arduino IDE fails on: February 21, 2012, 02:23:07 pm
First: I have Arduino 1.0 installed on a amd64 Linux system (2.6.32-34-generic #77-Ubuntu).

The desired target is an ATtiny85 chip running at 8MHz. In the Arduino, I select Tools->board->ATtiny85 (internal 8HMz clock). My programmer is a USBasp.


  • I have compiled the project code for a nano328 target for testing and it successfully uploads via the usb port.
  • I have compiled the project code for a ATtiny85 target and it successfully uploads via the USBasp programmer when invoked from the Command Line.
  • I have compiled the project code for a ATtiny85 target and it fails to upload via the USBasp programmer when invoked from Arduino IDE.

As stated above, I can successfully burn ATtiny85 chips with my USBasp programmer with avrdude from the Command Line, but using the ArduinoIDE fails with these java errors:
Code:
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:443)
at java.lang.Integer.parseInt(Integer.java:514)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:81)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:66)
at processing.app.Sketch.upload(Sketch.java:1664)
at processing.app.Sketch.exportApplet(Sketch.java:1624)
at processing.app.Sketch.exportApplet(Sketch.java:1578)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2314)
at java.lang.Thread.run(Thread.java:636)

After Googling every on-line posting that seemed to be related to similar problems, I became suspicious of the boards.txt and programmers.txt files. I have double checked them and even changed the case of USBasp to usbasp, as suggested in an old forum post, to no avail.

My ~/arduino/arduino-1.0/hardware/arduino/programmers.txt file is:
Code:
...
usbasp.name=usbasp
usbasp.communication=usb
usbasp.protocol=usbasp
...

My ~/arduino/arduino-1.0/hardware/arduino/boards.txt file contains no ATtiny data

The Tools->board->ATtiny85 (internal 8HMz clock) selection comes from ~/arduino/arduino-1.0/sketchbook/hardware/attiny/boards.txt
My ~/arduino/arduino-1.0/sketchbook/hardware/attiny/boards.txt is:
Code:
attiny45.name=ATtiny45 (internal 1 MHz clock)
attiny45.upload.protocol=usbasp
attiny45.bootloader.low_fuses=0x62
attiny45.bootloader.high_fuses=0xdf
attiny45.bootloader.extended_fuses=0xff
attiny45.upload.maximum_size=4096
attiny45.build.mcu=attiny45
attiny45.build.f_cpu=1000000L
attiny45.build.core=arduino:arduino
attiny45.build.variant=tiny8

attiny45-8.name=ATtiny45 (internal 8 MHz clock)
attiny45-8.upload.protocol=usbasp
attiny45-8.bootloader.low_fuses=0xe2
attiny45-8.bootloader.high_fuses=0xdf
attiny45-8.bootloader.extended_fuses=0xff
attiny45-8.upload.maximum_size=4096
attiny45-8.build.mcu=attiny45
attiny45-8.build.f_cpu=8000000L
attiny45-8.build.core=arduino:arduino
attiny45-8.build.variant=tiny8

attiny45-20.name=ATtiny45 (external 20 MHz clock)
attiny45-20.upload.protocol=usbasp
attiny45-20.bootloader.low_fuses=0xfe
attiny45-20.bootloader.high_fuses=0xdf
attiny45-20.bootloader.extended_fuses=0xff
attiny45-20.upload.maximum_size=4096
attiny45-20.build.mcu=attiny45
attiny45-20.build.f_cpu=20000000L
attiny45-20.build.core=arduino:arduino
attiny45-20.build.variant=tiny8

attiny85.name=ATtiny85 (internal 1 MHz clock)
attiny85.upload.protocol=usbasp
attiny85.bootloader.low_fuses=0x62
attiny85.bootloader.high_fuses=0xdf
attiny85.bootloader.extended_fuses=0xff
attiny85.upload.maximum_size=8192
attiny85.build.mcu=attiny85
attiny85.build.f_cpu=1000000L
attiny85.build.core=arduino:arduino
attiny85.build.variant=tiny8

attiny85-8.name=ATtiny85 (internal 8 MHz clock)
attiny85-8.upload.using=usbasp
attiny85-8.upload.protocol=usbasp
attiny85-8.bootloader.low_fuses=0xe2
attiny85-8.bootloader.high_fuses=0xdf
attiny85-8.bootloader.extended_fuses=0xff
attiny85-8.upload.maximum_size=8192
attiny85-8.build.mcu=attiny85
attiny85-8.build.f_cpu=8000000L
attiny85-8.build.core=arduino:arduino
attiny85-8.build.variant=tiny8

attiny85-20.name=ATtiny85 (external 20 MHz clock)
attiny85-20.upload.protocol=usbasp
attiny85-20.bootloader.low_fuses=0xfe
attiny85-20.bootloader.high_fuses=0xd7
attiny85-20.bootloader.extended_fuses=0xff
attiny85-20.upload.maximum_size=8192
attiny85-20.build.mcu=attiny85
attiny85-20.build.f_cpu=20000000L
attiny85-20.build.core=arduino:arduino
attiny85-20.build.variant=tiny8

attiny44.name=ATtiny44 (internal 1 MHz clock)
attiny44.upload.protocol=usbasp
attiny44.bootloader.low_fuses=0x62
attiny44.bootloader.high_fuses=0xdf
attiny44.bootloader.extended_fuses=0xff
attiny44.upload.maximum_size=4096
attiny44.build.mcu=attiny44
attiny44.build.f_cpu=1000000L
attiny44.build.core=arduino:arduino
attiny44.build.variant=tiny14

attiny44-8.name=ATtiny44 (internal 8 MHz clock)
attiny44-8.upload.protocol=usbasp
attiny44-8.bootloader.low_fuses=0xe2
attiny44-8.bootloader.high_fuses=0xdf
attiny44-8.bootloader.extended_fuses=0xff
attiny44-8.upload.maximum_size=4096
attiny44-8.build.mcu=attiny44
attiny44-8.build.f_cpu=8000000L
attiny44-8.build.core=arduino:arduino
attiny44-8.build.variant=tiny14

attiny44-20.name=ATtiny44 (external 20 MHz clock)
attiny44-20.upload.protocol=usbasp
attiny44-20.bootloader.low_fuses=0xfe
attiny44-20.bootloader.high_fuses=0xdf
attiny44-20.bootloader.extended_fuses=0xff
attiny44-20.upload.maximum_size=4096
attiny44-20.build.mcu=attiny44
attiny44-20.build.f_cpu=20000000L
attiny44-20.build.core=arduino:arduino
attiny44-20.build.variant=tiny14

attiny84.name=ATtiny84 (internal 1 MHz clock)
attiny84.upload.protocol=usbasp
attiny84.bootloader.low_fuses=0x62
attiny84.bootloader.high_fuses=0xdf
attiny84.bootloader.extended_fuses=0xff
attiny84.upload.maximum_size=8192
attiny84.build.mcu=attiny84
attiny84.build.f_cpu=1000000L
attiny84.build.core=arduino:arduino
attiny84.build.variant=tiny14

attiny84-8.name=ATtiny84 (internal 8 MHz clock)
attiny84-8.upload.protocol=usbasp
attiny84-8.bootloader.low_fuses=0xe2
attiny84-8.bootloader.high_fuses=0xdf
attiny84-8.bootloader.extended_fuses=0xff
attiny84-8.upload.maximum_size=8192
attiny84-8.build.mcu=attiny84
attiny84-8.build.f_cpu=8000000L
attiny84-8.build.core=arduino:arduino
attiny84-8.build.variant=tiny14

attiny84-20.name=ATtiny84 (external 20 MHz clock)
attiny84-20.upload.protocol=usbasp
attiny84-20.bootloader.low_fuses=0xfe
attiny84-20.bootloader.high_fuses=0xdf
attiny84-20.bootloader.extended_fuses=0xff
attiny84-20.upload.maximum_size=8192
attiny84-20.build.mcu=attiny84
attiny84-20.build.f_cpu=20000000L
attiny84-20.build.core=arduino:arduino
attiny84-20.build.variant=tiny14

Any help would be appreciated.
27  Using Arduino / Motors, Mechanics, and Power / Re: 28BYJ-48 5-Volt Stepper on: February 06, 2012, 11:02:07 pm
The nano's supply is inadequate for the stepper. I used a separate 5v supply and just tied the grounds.
28  Development / Other Software Development / averdude requires sudo for USBasp - a fix on: February 06, 2012, 07:26:11 am
The fact is that, unless run as sudo (in Debian), averdude fails to find the USBasp programmer. Entering the password for sudo gets to be a pain. There is a fix. The site at the link below lists the cure - a new entry in /etc/udev/rules.d
http://mightyohm.com/blog/2010/03/run-avrdude-without-root-privs-in-ubuntu/

That site's fix is for the USBTinyISP programmer. For the USBasp programmer, in a new file /etc/udev/rules.d/10-usbasp.rules
insert:
SUBSYSTEM=="usb", SYSFS{idVendor}=="16c0", SYSFS{idProduct}=="05dc", GROUP="adm", MODE="0666

Caveat emptor:
If this scares you or you are too unfamiliar with the udev system, then don't do it and continue to use the sudo command. Making a mistake can screw up your system.
29  Using Arduino / Motors, Mechanics, and Power / Re: 28BYJ-48 5-Volt Stepper on: February 06, 2012, 06:39:26 am
The wiring is listed in the sketch. I also used a nano as well as a mini-pro. The power pins on ULN2003 driver board, if yours is the same as mine, are poorly marked. Ground goes to the pin marked with a very litttle "-" and 5-volts Vcc is connected to the pin marked "+". For the ULN2003 driver board's LEDs to light the jumper must be in place - it is unmarked and is adjacent to the power pins.

From the sketch
...
int motorPin1 = 8;   // Blue   - 28BYJ48 pin 1
int motorPin2 = 9;   // Pink   - 28BYJ48 pin 2
int motorPin3 = 10;   // Yellow - 28BYJ48 pin 3
int motorPin4 = 11;   // Orange - 28BYJ48 pin 4
                        // Red    - 28BYJ48 pin 5 (VCC)

#define STEPS  64   //Number of steps per revolution

//The pin connections need to be 4 pins connected
// to Motor Driver In1, In2, In3, In4 ...
...
30  Using Arduino / Displays / Re: Shift Register Libraries for LCD Displays on: February 05, 2012, 11:33:52 pm
added to original post
Pages: 1 [2] 3 4