Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 72
61  Using Arduino / Microcontrollers / Re: ATtiny85 Counter/Timer0 Input for Frequency Capture on: February 25, 2014, 11:30:12 am
Update:
I just tried my sketch below using a tuned ATtiny85.

With a input frequence at 54.366 HZ my output was 54592.
Thats an error of 0,4%

Code:
#include <TinyDebugKnockBang.h>

volatile unsigned long Count;
long previousMillis = 0;
long interval = 1000;

ISR(PCINT0_vect) {
  Count++;
}

void setup()
{
  OSCCAL = 0x69;
  Debug.begin(250000);
  Debug.println("Freq......");
  GIMSK = _BV(PCIE);    // Enable pin change interrupt Table 9.3.2
  PCMSK = _BV(PCINT4);  // Enable the interrupt for only pin 4,Table 9.3.4
}

void loop ()   {
unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;   
    Debug.println("Count  ");
    Debug.println(Count/2);
    Count=0;
  }
} //loop
62  Using Arduino / Microcontrollers / Re: ATtiny85 Counter/Timer0 Input for Frequency Capture on: February 25, 2014, 09:04:25 am
Quote
My results are not as accurate as I'd like. 5% error if my measurements are correct.

The internal oscillator is not very accurate, it can be off by 10%.
You can tune it to be within 1%
63  Using Arduino / Microcontrollers / Re: Using ATTiny84 with DS18B20 temp sensor as temperature logger on: February 24, 2014, 09:42:43 am
I have done it, using ATtimy85, so I can't see why not.

http://forum.arduino.cc/index.php?PHPSESSID=pj61g4bqqengv8m112nh5encg3&topic=216663.0

edit:
I am using this core for tinys
https://code.google.com/p/arduino-tiny/
64  Using Arduino / Microcontrollers / Re: Erratic behaviour with software serial and eeprom, attiny 84, tinyisp on: February 23, 2014, 06:06:58 am
I think the first thing I would consider is tuning the internal osccilator.
If it is too much off it will cause trouble with SoftwareSerial  (or any other serial comm)

You could use TinyTuner2 to do the tuning.

http://forum.arduino.cc/index.php?topic=173408.0
65  Using Arduino / Microcontrollers / Re: Uploading to Attiny with an Arduino on: February 22, 2014, 12:04:34 pm
Quote
Wrong microcontroller found.

This tells you that you have chosen the wrong board, the -F won't help.

I wonder if you are following the right steps, and all of them ?.


1. Upload the ArduinoISP to the Arduino dont't connect the capacitor yet.
2 Connect a 10 µF capacitor from reset to ground on the arduino (negative side to ground)
3. Open the blink sketch and change pin13 to pin3
4. select Tools -> board -> Attiny85@1MHZ (leave the serial port as it is)
5. Select Tools -> Programmer -> Arduino as ISP
6. Select File -> upload using programmer
7. Connect a LED with resitor to pin PB3

Now you should have a blinkining Led on your Attiny85
66  Using Arduino / Microcontrollers / Re: Uploading to Attiny with an Arduino on: February 22, 2014, 08:02:08 am
First you will have to install the specific files for the tiny, called a core.

I can recommend this one:

https://code.google.com/p/arduino-tiny/

As you see there is a version for either IDE version 1.0x or 1.5.x
Follow the read.me file when you install the files

Then you just follow these steps:

http://www.ernstc.dk/arduino/attiny85.html
67  Using Arduino / Microcontrollers / Re: SoftwareSerial with ATTiny84 using ATtiny library on: February 19, 2014, 09:17:37 am
I'm afraid that I am to blame for  the confusion.

I have corrected the pin names/numbers here

http://www.ernstc.dk/arduino/tinycom.html

You can use this reference sheet to see both digital and analog pinnumbers.

http://www.akafugu.jp/images/microcontroller-reference-sheet.png

For example physical pin 10 is digital 7 and analog 3
so:
digitalWrite(7,HIGH); will set physical pin 10 (or PA3) high
analogRead(3);  will read from physical pin 10 (or PA3)

BTW
PA3 is short for PortA pin3
68  Development / Other Hardware Development / Re: Can't upload to Iteaduino Lite on Linux/debian on: February 15, 2014, 07:03:46 am
My Iteaduino Lite worked out of the box.
I am on windows (Vista), if it can be of any help here is my verbose output:

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 "D:\arduino-1.0.4-windows\arduino-1.0.4\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM13
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
         AVR Part                      : ATMEGA88
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :
69  Using Arduino / Microcontrollers / Re: ATtiny85 communication with other MC - Help with deciding on: February 14, 2014, 11:27:23 am
Quote
I don't think I'll be able to use serial easily as I need to communicate with another MCU.

I don't understand what yoym mean. Serial communication between MCU's are quite normal.
I have a ATtiny85 communicating with my Raspberry Pi via serial
70  Using Arduino / Microcontrollers / Re: ATtiny85 communication with other MC - Help with deciding on: February 14, 2014, 07:45:53 am
BTW I once made a simple freqence counter with an ATtiny85, using PCINT
I don't rember the upper freqence limit

Code:
volatile unsigned long Count;
long previousMillis = 0;
long interval = 1000;

ISR(PCINT0_vect) {
  Count++;
}

void setup()
{
  Serial.begin(9600);
  Serial.println("Freq......");
  GIMSK = _BV(PCIE);    // Enable pin change interrupt Table 9.3.2
  PCMSK = _BV(PCINT4);  // Enable the interrupt for only pin 4,Table 9.3.4
}

void loop ()   {
unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;   
    Serial.println("Count  ");
    Serial.println(Count);
    Count=0;
  }
} //loop

71  Using Arduino / Microcontrollers / Re: ATtiny85 communication with other MC - Help with deciding on: February 14, 2014, 05:03:03 am
For communication you could use TinyDebugSerial, it is part of the core you are using.
It works the same way as on the UNO and the syntax is the same:
So this would output Serial on pin PB3

Code:
void setup() {
Serial.begin(9600);
}

void loop() {
Serial.println("Testing..");
}


https://code.google.com/p/arduino-tiny/
72  Using Arduino / Microcontrollers / Re: attiny 2313 and servos on: February 12, 2014, 02:53:51 pm
tylernt has made a servo library for tinys:

http://forum.arduino.cc/index.php?topic=198337.msg1463365#msg1463365
73  International / Scandinavia / Re: Hjælp til water level sensor code on: February 11, 2014, 09:44:18 am
Hvis du har et ptentiometer, kan du bruge det til at teste med.
Det er sikkert også lettere og så ungår du vandpjaskeri:

http://arduino.cc/en/Tutorial/ReadAnalogVoltage

Har du et link til dine sensorer ?
74  Using Arduino / Microcontrollers / Re: Using a OneWire device with a ATtiny85 on: February 11, 2014, 09:17:34 am
That is strange !

I don't know if it matters but I run the ATtiny85 @ 8MHz.

This is how I define the pin connected to the sensor

Code:
OneWire  ds(3);  // on pin PB3 (a 4.7K resistor is necessary)
75  Development / Other Software Development / Re: An ATtiny core collection for IDE 1.5.3 (Aka. Nightly Build) on: February 11, 2014, 09:09:34 am



attiny84at16.upload.tool=arduino:arduinoisp
attiny84at16.upload.tool=avrispv2
attiny84at16.upload.tool=pololu
Pages: 1 ... 3 4 [5] 6 7 ... 72