ATtiny 861a

Well I am brand new to this world so forgive me if I am not asking the right question. I am trying to program an ATtiny861a and i am not able to find that chip in any library or updated library. I am hoping someone out there can help me with this and hopefully I didn't choose the 1 chip that couldn't be programmed with Arduino!

Thanks for your help.

I believe you are looking for "core" rather than a library.

See: Programming ATtiny861 with Arduino - Suggestions for the Arduino Project - Arduino Forum

http://forum.arduino.cc/index.php?topic=173408.0

Moderator edit: session ID removed

Thanks so much ( @Erni ) I got the Attiny861 board now showing in my arduino IDE along with my USBtiny ISP!

Now if I could only know how to actually transfer my code to the chip.

Sorry I am a baby in this world! I have never seen this stuff before and I have the completed code, however I have know Idea how to get it on the chip!!

Thanks again, now back to my researching!

OJ

The first step is to connect your programmer to the attiny

Load the sketch you want to compile and upload to the tiny
Select tools->board->Attiny 861 @ 1 MHz
Select tools->Programmer-USBtinyISP
Select File->upload using programmer

If you want the tiny to use other clock speed:

Select Board -> Attiny861 @8MHZ
Select ->Burn bootloader

This step do not burn a bootloader to your chip, it is only used to set the fuses to another clock-speed.

@Erni

Just tried it ant I am getting the following error.

Alex_Motor_Limit_Switch_Code_v2.ino: In function 'void loop()':
Alex_Motor_Limit_Switch_Code_v2:29: error: 'analogWrite' was not declared in this scope
Alex_Motor_Limit_Switch_Code_v2:30: error: 'delay' was not declared in this scope
Alex_Motor_Limit_Switch_Code_v2:35: error: 'analogWrite' was not declared in this scope
Alex_Motor_Limit_Switch_Code_v2:36: error: 'delay' was not declared in this scope
Alex_Motor_Limit_Switch_Code_v2:45: error: 'analogWrite' was not declared in this scope
Alex_Motor_Limit_Switch_Code_v2:46: error: 'delay' was not declared in this scope
Alex_Motor_Limit_Switch_Code_v2:52: error: 'analogWrite' was not declared in this scope
Alex_Motor_Limit_Switch_Code_v2:53: error: 'delay' was not declared in this scope

Here is the code if I am doing something wrong.

#define DIR_CLOCKWISE 0
#define DIR_COUNTERCW 1
#define DELAY_TIME 30

int Motor_Direction = 12; // arduino pin 12
int Motor_Speed = 3; // arduino pin 3

void setup()
{

pinMode(Motor_Direction, OUTPUT);
pinMode(Motor_Speed, OUTPUT);

}

void loop()
{
int incrementCounter;

digitalWrite(Motor_Direction, DIR_CLOCKWISE); // set motor A to Clockwise rotation

// start motor at zero speed and ramp up to maximum speed
for(incrementCounter = 0; incrementCounter<256; incrementCounter++)
{
analogWrite(Motor_Speed, incrementCounter);
delay(DELAY_TIME);
}
// start motor at maximum and ramp down to zero speed
for(incrementCounter = 255; incrementCounter>-1; incrementCounter--)
{
analogWrite(Motor_Speed, incrementCounter);
delay(DELAY_TIME);
}

// start again with motor turning the opposite way
digitalWrite(Motor_Direction, DIR_COUNTERCW); //

// start motor at zero speed and ramp up to maximum speed
for(incrementCounter = 0; incrementCounter<256; incrementCounter++)
{
analogWrite(Motor_Speed, incrementCounter);
delay(DELAY_TIME);
}

// start motor at maximum and ramp down to zero speed
for(incrementCounter = 255; incrementCounter>-1; incrementCounter--)
{
analogWrite(Motor_Speed, incrementCounter);
delay(DELAY_TIME);
}

}

These errors seem to indicate that the Tinycore files are not installed correct.

And I think it is easyer to start with a sketch you know is working, I prefer the blink sketch

The core has been reinstalled and I opened a new sketch and it worked fine.

#include <TinyDebugKnockBang.h>
#include <TinyTuner2.h>

static const uint8_t NO_PIN = (uint8_t)(-1);
static const uint8_t TogglePin = NO_PIN; // 3;

static void OutputOSCCALAssignment( void )
{
Debug.print( F( "\r\n\r\n // Add the following line of code to the top of setup...\r\n OSCCAL = 0x" ) );

TinyTuner2.tune();

Debug.print( OSCCAL, HEX );
Debug.println( F( ";" ) );

// delay( 2500 );
_delay_ms( 2500 );
}

void setup( void )
{
Debug.begin( 250000 );

if ( TogglePin != NO_PIN)
{
digitalWrite( TogglePin, HIGH );
pinMode( TogglePin, OUTPUT );
}

Debug.print( F( "\r\n\r\n // Initial value of OSCCAL is 0x" ) );
Debug.print( OSCCAL, HEX );
Debug.println( F( ";" ) );
_delay_ms( 1000 );

OutputOSCCALAssignment();
}

void loop( void )
{
OutputOSCCALAssignment();
}

After that I tried entering the code I was given and gave it the same libraries and still got the error. Not sure why its not recognizing the basic functions. I have been trying to make sense of the forum post that you gave me and I thought I did everything that I needed to.

You should use this core (Tom Carpenter)

The other core (Coding Badly) is not quite finished. Among other things, delay() and analogWrite() are not yet implemented, sorry about that I forgot

Your a life saver it is now compiling!

Now I am getting this error when I am trying to upload!

I am using the USBtiny ISP and then from there to a Custom PCB that is attached to a wire harness.

Binary sketch size: 1,120 bytes (of a 8,192 byte maximum)
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

My best guess is a loose/bad connection. You could try to test the connections with a ohm meter

Have you connected your programmer like this?
MOSI pin 1
MISO pin 2
SCK pin 3
Reset pin 10