- Fri Jan 06, 2017 2:03 pm
#192802
I'm using the SparkFun PGM-11801 Tiny Programmer with an ATtiny85-20PU controller. As per the SparkFun instructions, I believe I have installed the device correctly with the speed set to 1Mpbs, etc. When I upload to the Tiny from Arduino IDE v1.6.13, several errors are displayed but the program runs successfully. Re-powering the breadboard with the programmed chip results in successful operation, too.
I tested the program on the Arduino UNO Rev.3 before trying it on the Tiny so I know there are no issues.
Configuration: Test a single 74HC595 connected to a SparkFun COM-094837-segment 4-digit display. Test only the left-most digit. Use 110 or 220 ohm resistor to VCC and pin 1 of the display for the left-most digit..
==========================
The program is a simple test:
// ATtiny85
int latchPin = 2; // pin 12 on the 595: ST_CP, RCLK . Physical pin 7 on Tiny.
int dataPin = 3; // pin 14 on the 595: DS, DIO. Physical pin 2 on Tiny.
int clockPin = 4; // pin 11 on the 595: SH_CP, SCLK. Physical pin 3 on Tiny.
// Numbers 0 to 9 for common anode 4-digit 7-segment LED display from SparkFun: COM-09483 (YSD-439AR6B-35).
int TenCounter[] = {64,121,36,48,25,18,2,120,0,24};
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
}
void loop() {
for (int a=0; a<=9; a++) {
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST,TenCounter[a]);
digitalWrite(latchPin, HIGH);
delay(500);
}
}
=====================================
The errors are weird:
In file included from C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/Stream.h:26:0,
from C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/HardwareSerial.h:29,
from C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/Arduino.h:232,
from sketch\test.ino.cpp:1:
C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/Print.h:32:0: warning: "BIN" redefined
#define BIN 2
^
In file included from c:\users\dp\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\avr\iotn85.h:38:0,
from c:\users\dp\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\avr\io.h:428,
from c:\users\dp\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\avr\pgmspace.h:90,
from C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/Arduino.h:28,
from sketch\test.ino.cpp:1:
c:\users\dp\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\avr\iotnx5.h:55:0: note: this is the location of the previous definition
#define BIN 7
^
Sketch uses 784 bytes (9%) of program storage space. Maximum is 8,192 bytes.
Global variables use 29 bytes of dynamic memory.
Does anyone have any idea why the weird errors? I would like to move ahead with designing the physical board to include the Tiny85 but not if it's going to continue to act weird.
Thanks,
dp
I tested the program on the Arduino UNO Rev.3 before trying it on the Tiny so I know there are no issues.
Configuration: Test a single 74HC595 connected to a SparkFun COM-094837-segment 4-digit display. Test only the left-most digit. Use 110 or 220 ohm resistor to VCC and pin 1 of the display for the left-most digit..
==========================
The program is a simple test:
// ATtiny85
int latchPin = 2; // pin 12 on the 595: ST_CP, RCLK . Physical pin 7 on Tiny.
int dataPin = 3; // pin 14 on the 595: DS, DIO. Physical pin 2 on Tiny.
int clockPin = 4; // pin 11 on the 595: SH_CP, SCLK. Physical pin 3 on Tiny.
// Numbers 0 to 9 for common anode 4-digit 7-segment LED display from SparkFun: COM-09483 (YSD-439AR6B-35).
int TenCounter[] = {64,121,36,48,25,18,2,120,0,24};
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
}
void loop() {
for (int a=0; a<=9; a++) {
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST,TenCounter[a]);
digitalWrite(latchPin, HIGH);
delay(500);
}
}
=====================================
The errors are weird:
In file included from C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/Stream.h:26:0,
from C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/HardwareSerial.h:29,
from C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/Arduino.h:232,
from sketch\test.ino.cpp:1:
C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/Print.h:32:0: warning: "BIN" redefined
#define BIN 2
^
In file included from c:\users\dp\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\avr\iotn85.h:38:0,
from c:\users\dp\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\avr\io.h:428,
from c:\users\dp\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\avr\pgmspace.h:90,
from C:\Users\dp\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino/Arduino.h:28,
from sketch\test.ino.cpp:1:
c:\users\dp\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\avr\iotnx5.h:55:0: note: this is the location of the previous definition
#define BIN 7
^
Sketch uses 784 bytes (9%) of program storage space. Maximum is 8,192 bytes.
Global variables use 29 bytes of dynamic memory.
Does anyone have any idea why the weird errors? I would like to move ahead with designing the physical board to include the Tiny85 but not if it's going to continue to act weird.
Thanks,
dp