Show Posts
Pages: [1] 2 3 ... 12
1  Using Arduino / Programming Questions / Re: Arduino and AtTiny167 on: June 16, 2013, 06:10:29 pm
i honestly have no idea how to follow that, it really confuses me.

i decided to perhaps try a atmega48 but couldn't find the entry to add to the boards file in order to allow me to directly load a sketch into it once i loaded up the arduinoisp sketch to the arduino board.
2  Using Arduino / Programming Questions / Re: Arduino and AtTiny167 on: June 13, 2013, 12:59:28 pm
hey i decided to maybe give a mega168 chip a go instead as its a little more readily available,

the only thing is, im not entirely sure which selection to make from the boards menu to tell the arduino isp sketch which chip its being burnt too,

would it be arduino pro mega168? or do i need a custom entry to boards file?
3  Using Arduino / Programming Questions / Re: Arduino and AtTiny167 on: June 11, 2013, 10:33:57 pm
thank god for pinout diagrams haha.

thank you for that!
4  Using Arduino / Programming Questions / Re: Arduino and AtTiny167 on: June 11, 2013, 10:23:52 pm
thats an 8 pin tiny, the pinout on the 167 is different, the vcc and gnd are in the middle, thats about all i know so far
5  Using Arduino / Programming Questions / Arduino and AtTiny167 on: June 11, 2013, 10:07:11 pm
hi all, can someone tell me which pins from an arduino uno need to connect to an AtTiny167 chip to program it? (the chip)

also, which pins on the 167 are the pwm channels?

basically i need a 12 (or 20) pin rogrammable micro controller with 6 pwm pins that i can program using the arduino board
6  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 18, 2013, 06:25:08 am
i set it to 8mhz and used pin o and pin 1 for pwm. then pin 3 and 4 for analogwrite functions
7  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 17, 2013, 07:09:47 pm
never mind it was pwm channels messing it up, all fixed and fully working now.

thanks guys
8  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 17, 2013, 06:49:18 pm
I got the sketch loaded onto the chip.

But its behaving badly. indicators aren't flashing, the "headlight" keeps going off and not changing brightness as it should, infact the ONLY one thats working right is the rear light led. and even that turns itself off occasionally.

any suggestions?
9  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 17, 2013, 05:48:14 pm
but with the chip gnd connected they are all off

Then take a step back and work with a very basic Blink sketch.  Once you have that working, expand it to blink LEDs on all five pins.  If that works, you know the hardware is ready.  Then move on to the Motorcycle Prototype sketch.

As long as you have proper current-limiting resistors on the LEDs, you can leave everything in place during programming.


I've tested the pins with single leds and all the pins work, its just the sketch itself is not running on the chip, I'd really like to keep the sketch i already have rather than try and write a whole new one. so any help would be appreciated
10  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 17, 2013, 05:40:33 pm
yeah i found this out by mistake. the chip should be fine, i just dont quite get why my sketch doesn't work on the chip but the "blink" does.
11  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 17, 2013, 05:33:44 pm
I just want to shout out and say thank you to you guys for sticking with me on this adventure, im learning an aweful lot so far and i know im not the easiest person to work with, so thank you.
12  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 17, 2013, 05:32:18 pm
yes, gnd on the 85 not connected, but the led gnd's and arduino gnd together and the leds turn on, static, not doing anything, very dim.

but with the chip gnd connected they are all off.

led + to resistor to tiny85 pins
led - to tiny85 pin4 gnd

one led per output pin (so 6 in total)

arduino +5v to tiny85 pin8 Vcc
arduino GND to tiny85 pin 4 gnd.
13  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 17, 2013, 05:23:58 pm
here is the verbose


Moderator edit: link corrected again
14  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 17, 2013, 05:03:53 pm
legend!

got the blink sketch uploaded!

I managed to dig up lady ada's isp sketch with the pulses? i loaded that up, then put on the blink sketch.

Now, heres where things get more complicated, I'll post the code i want to load onto it. Note the library used, i dont know if it is supported (fingers crossed)

when i load this code on, i connect a led via resistor to each of the chips outputs, 5v on Vcc and led grounds to chip ground to arduino ground (im using the arduino as a power source for the tests with the chip seperated from the arduino programming board i made) and i get 2 results, no leds come on, if i seperate the chip ground so only the arduino and led grnds are connected they all come on.

any ideas?

heres the code:

Code:
// Motorcycle Prototype MkII

#include <LedFlasher.h>

const byte FrontPin = 4;           
const byte RightIndicatorPin = 3;
const byte LeftIndicatorPin = 2;
const byte RearPin = 1;

// Flashers                     pin                  off-time  on-time       on?
LedFlasher LeftIndicator    (LeftIndicatorPin,        500,       500,     false);
LedFlasher RightIndicator   (RightIndicatorPin,       500,       500,     false);

// states for the state machine
typedef enum
  {
  initialState,
  wantDippedBeam,
  wantHighBeam, 
  wantHighBeamOff,
  wantLeftIndicator,           
  wantRightIndicator,
  wantLeftIndicatorOff,
  wantRightIndicatorOff,
  wantRearLight,
  wantRearBrake,
  wantRearBrake2,
  wantRearBrakeOff,
  wantRearBrakeOff2, 
  } states;

// state machine variables
states state = initialState;
unsigned long lastStateChange = 0;
unsigned long timeInThisState = 1000;

void setup ()
  {
  pinMode (FrontPin, OUTPUT);
  pinMode (RearPin, OUTPUT);
   
  // set up flashers 
  LeftIndicator.begin ();
  RightIndicator.begin ();
  }  // end of setup
       
void doStateChange ()
  {
  lastStateChange = millis ();    // when we last changed states
  timeInThisState = 1000;         // default one second between states

  switch (state)
   {
    case initialState:
         state = wantDippedBeam;
         break;
         
    case wantDippedBeam:
         analogWrite (FrontPin, 125);
         state = wantRearLight;
         break;
         
    case wantRearLight:
         analogWrite (RearPin, 125);
         state = wantRearBrake;
         timeInThisState = 50000;
         break;

    case wantRearBrake:
         analogWrite (RearPin, 255);
         state = wantLeftIndicator;
         break;
         
    case wantLeftIndicator:
         LeftIndicator.on();
         state = wantRearBrakeOff;
         timeInThisState = 5000;
         break;
         
    case wantRearBrakeOff:
         analogWrite (RearPin, 125);
         state = wantLeftIndicatorOff;
         timeInThisState = 5000;
         break;
   
    case wantLeftIndicatorOff:
         LeftIndicator.off();
         state = wantHighBeam;
         timeInThisState = 50000;
         break;
         
    case wantHighBeam:
         analogWrite (FrontPin, 255);
         state = wantRearBrake2;
         timeInThisState = 20000;
         break;
         
    case wantRearBrake2:
         analogWrite(RearPin, 255);
         state = wantRightIndicator;
         break;
         
    case wantRightIndicator:
         RightIndicator.on();
         state = wantRearBrakeOff2;
         timeInThisState = 5000;
         break;
         
    case wantRearBrakeOff2:
         analogWrite(RearPin, 125);
         state = wantRightIndicatorOff;
         timeInThisState = 5000;
         break;
         
    case wantRightIndicatorOff:
         RightIndicator.off();
         state = wantHighBeamOff;
         timeInThisState = 50000;
         break;
         
    case wantHighBeamOff:
         analogWrite (FrontPin, 125);
         state = wantDippedBeam;
         break;
    }  // end of switch on state
  }  // end of doStateChange


void loop ()
  {
   if (millis () - lastStateChange >= timeInThisState)
     doStateChange ();
   // update flashers
   LeftIndicator.update ();
   RightIndicator.update ();
   
  }  // end of loop
15  Using Arduino / Programming Questions / Re: arduino uno > AtTiny85 on: May 17, 2013, 03:41:35 pm
so i've removed any chance of loose connections by making a soldered socket. like the protoshields but all soldered up.

perhaps someone can translate this

Code:
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: Send: P [50]   [20]
avrdude: Recv:
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: Send: Q [51]   [20]
avrdude: Recv:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done.  Thank you.

okay so helps if you remember the Vcc wire....

now im getting this, can someone tell me what it means?

Code:
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\gaming\Documents\Arduino\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.
Pages: [1] 2 3 ... 12