SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By dprefont
#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
By jremington
#192811
There is not a "weird error". It is simply a warning informing you that the compile-time constant BIN is being redefined.

If everything works in the end, then the redefinition is probably appropriate.

As to why the warning occurs, perhaps you have installed a mixture of up-to-date and older software. That is a very old version of the Arduino IDE.
By dprefont
#192818
I took the various bits of advice and did the following:
- Uninstalled Arduino IDE v1.6.13 and cleaned out all of the folders after ensuring my sketches would be preserved. I expect most of the drivers needed for the other devices will have to be reinstalled at a later date.
- Deleted the Arduino15 folder under Users\... and C:\Program Files (x86)\Arduino
- Installed the v1.8.0 IDE
- Followed SparkFun's installation instructions for their product: https://www.sparkfun.com/products/11801
- The ATtiny85 could not be found in the Board Manager until the following were added in File > Preferences > Additional Boards Manager URLs: https://raw.githubusercontent.com/spark ... index.json,
https://raw.githubusercontent.com/damel ... index.json
(These are the same actions I performed originally and are here for others who may have run into installation problems.)

Anyway, to the point: the download to the Tiny worked without any errors or unusual (to me) messages. Thanks for your help.