Show Posts
Pages: 1 2 [3] 4 5 ... 71
31  Products / Arduino Yún / Re: Yun suddenly will not upload sketches on: March 04, 2014, 06:00:45 am
Thisn is what I did

http://forum.arduino.cc/index.php?topic=189570.0
32  Using Arduino / Installation & Troubleshooting / Re: Yun suddenly will not upload sketches on: March 04, 2014, 05:57:04 am
Quote
I'm not sure what "Arduino as ISP" means
It means you use an Arduino withe the sketch ArduinoISP ,as a programmer,

Take a look at this.

http://www.gammon.com.au/forum/?id=11643
33  Using Arduino / Installation & Troubleshooting / Re: Yun suddenly will not upload sketches on: March 03, 2014, 03:04:22 pm
Did  you try to upload a sketch via LAN ?

I once had the  problem that the bootloader disappeared, which gave the same symptons as you describe.
I reburned the bootloader using Arduino as ISP.

But i think there might be easyer solutions, I think it would be better asking in the Yun subforum
34  Using Arduino / LEDs and Multiplexing / Re: 38khz IR Signal using ATTINY85 on: March 03, 2014, 08:51:53 am
Quote
When you say 0 it is PB0 (physical pin 5) and 3 means PB3 (physical pin 2) right. S

Yes that was what I meant.

Actually this might be easyer. This sketch will output on pin 0 (PB0), so you just connect your IR-led like the drawing.

Code:
//Attiny85 IR-test
//Attiny85 , running @ 8MHZ
// ATMEL ATTINY45 / ARDUINO
//
//                           +-\/-+
//  Ain0       (D  5)  PB5  1|    |8   VCC
//  Ain3       (D  3)  PB3  2|    |7   PB2  (D  2)  INT0  Ain1
//  Ain2       (D  4)  PB4  3|    |6   PB1  (D  1)        pwm1
//                     GND  4|    |5   PB0  (D  0)        pwm0
//                           +----+
void setup(){
  DDRB |= (1<<PB0); //Set pin PB0 as output
  TCNT0 = 0;
  TCCR0A=0;
  TCCR0B=0;

  TCCR0A |=(1<<COM0A0); //Timer0 in toggle mode Table 11-2
  TCCR0A |=(1<<WGM01); //Start timer 1 in CTC mode Table 11.5
  TCCR0B |= (1 << CS00);// Prescaler table 11.6
  OCR0A=104; //CTC Compare value
}

void loop(){
  TCCR0A &= ~(1<<COM0A0); //off
  delay(1000);
  TCCR0A |=(1<<COM0A0); //on
  delay(1000);
}
35  Using Arduino / LEDs and Multiplexing / Re: 38khz IR Signal using ATTINY85 on: March 03, 2014, 06:28:17 am
Quote
Pin 0 is the reset pin

No, take a look at the pinout

Code:
       +-\/-+
 PB5  1|    |8   VCC
 PB3  2|    |7   PB2
 PB4  3|    |6   PB1
 GND  4|    |5   PB0
       +----+

If you connect the IR diode as I suggested the output will be like the picture from my logic analyzer.

I think it would be easyer to check the output if you use a longer delay, f.ex. 1 second on/off


36  Using Arduino / LEDs and Multiplexing / Re: 38khz IR Signal using ATTINY85 on: March 02, 2014, 10:42:19 am
One way to do it is to connect your IR-diode between pin 3 and pin 0 (with a resitor in serie)
That way the diode is on only when pin 3 is LOW.
Don't expect too much precision, partly bescause you don't use a x-tal (asumption) and partly because there are some overhead in the loop.
BTW the code asumes the Attiny85 is running @ 8 MHZ.

Code:
/*
Anode (long leg connected) to 0
Cathode (short leg to 3 through resistor)
 */
void setup(){
  TCNT0 = 0;
  TCCR0A=0;
  TCCR0B=0;

  TCCR0A |=(1<<COM0A0); //Timer0 in toggle mode Table 11.2
  TCCR0A |=(1<<WGM01); //Start timer 0 in CTC mode Table 11.5
  TCCR0B |= (1 << CS00);// Prescaler Table 11.6
  OCR0A=105; //CTC Compare value
  pinMode(0,OUTPUT);
  pinMode(3,OUTPUT);
}

void loop(){
  PORTB |=_BV(3);  //off
  delayMicroseconds(500);
  PORTB &=~_BV(3);  //on
  delayMicroseconds(400);
}
37  Using Arduino / Microcontrollers / Re: DS18B20 on Attiny85 on: February 28, 2014, 10:41:24 am
Take a look at two recent threads about  DS18B20 on Attiny84/85

http://forum.arduino.cc/index.php?PHPSESSID=pj61g4bqqengv8m112nh5encg3&topic=216663.0
38  Using Arduino / Microcontrollers / Re: SoftwareSerial with ATTiny84 using ATtiny library on: February 28, 2014, 10:37:21 am
Please post your sketch
39  Using Arduino / Microcontrollers / Re: SoftwareSerial with ATTiny84 using ATtiny library on: February 28, 2014, 09:06:23 am
This is what i have in the _TinyISP_BuildOptions.h tab when using KnockBang.

Code:
//Set to 1 if using KnockBang and comment out #include <SoftwareSerial.h> in TinyISP
#define RELAY_KNOCK_BANG_ENABLED 1

//Set to 1 if using Serial Relay, and uncomment #include <SoftwareSerial.h> in TinyISP
//Transmit on Arduino is A0
#define RELAY_SERIAL_ENABLED  0

And in the TinyISP tab I comment out #include <SoftwareSerial.h>

Code:
//#include <SoftwareSerial.h>
40  Using Arduino / Microcontrollers / Re: [ATTINY85]Nothing but junk appears on my serial monitor... :( on: February 28, 2014, 08:57:51 am
I did an experiment with SoftwareSerial

ATtiny85V - 10 @ 8MHz
10 kOHM resistor from reset to VCC
0.1 uF from VCC to grnd

Tuned at 21 degree Celcius, and 5V (USB power)
Test sketch below:
Serial @ 9600

I started it at 21 degree and then put it in my frezer at -18 degree for half an hour.
Result: nothing - no garbled text it just continued to write flawlessly.

Then I stuck it on a room heater for another half hour at 30 degree, and it just kept on without failure

Lastly I borrowed my wife's hairdryer,the temperature now +50 degree and still no errors.

Next step was to try to lower VCC

At 1.9V the text began to be garbled
Under 1.8V it stopped and resat
At 2V No problems at all.

So not bad, atleast it is good enough for me.
I can only guess that the problems with SoftwareSerial that is reported is because of lack of tuning.

Code:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(3,4 ); //rx=3,tx=4 setup of software serial
unsigned int x=0;

void setup() {
  OSCCAL = 0x68; 
  mySerial.begin(9600);
  x=0;
}

void loop() {
  x++;

  mySerial.print("Test= "); 
  mySerial.println(x);
  delay(500);
}
41  Using Arduino / Microcontrollers / Re: Using ATTiny84 with DS18B20 temp sensor as temperature logger on: February 27, 2014, 03:18:05 pm
Quote
'Reset the processor.  A welcome message should be displayed.'

You breefly connect the reset pin (PB3) to ground, and you will see this in the serial monitor:

Code:
--------------------------------------------------------------------------------
Poor Man's Tiny Tuner
Slowly send lowercase 'x' to tune the oscillator...

  // Starting OSCCAL value is 0x9C

Step  OSCCAL
  1    

Then you start sending x 's.
You get a new line for every x, as the tuner try to determin the right OSCCAL value.

This is the final result for my particular ATtiny84

Code:
Poor Man's Tiny Tuner
Slowly send lowercase 'x' to tune the oscillator...

  // Starting OSCCAL value is 0x9C

Step  OSCCAL
  1     9F
  2     9E
  3     9F
  4     9F
  5     9F
  6     9F
  7     9E
  8     9E
  9     A0
 10     A0
 11     A0
 12     A0
 13     A0
 14     9F

Copy-and-paste the following line of code at the top of setup...

  OSCCAL = 0x9F;


So in my sketch i will place this value in setup()

Code:
void setup(){

OSCCAL = 0x9F;

//other code

}

BYTW this is TinyTuner 1
42  Using Arduino / Microcontrollers / Re: Using ATTiny84 with DS18B20 temp sensor as temperature logger on: February 27, 2014, 06:17:50 am
The garbled text could be a sympton of bad timing.

You can tune the internal osccilator by setting a value for the  OSCCAL

There are sevaral option for tuning.
Coding Badly has made TinyTuner

TinyTuner 1

http://forum.arduino.cc/index.php/topic,8553.0.html

And TinyTuner2

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


Another option is to use SoftwareSerial as an indicator for the tuning.
If you load this sketch to your Attiny84 it will output the OSCCAL value to the serial monitor.
A potmeter connected to PA3 will vary the OSCALL value, and you will see the output going
from garbled to readable and garbled again. Then you pick a value in tyhe midlle of the readable text.

Code:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2,3 ); //rx=PB2,tx=PA7 setup of software serial

void setup() {
  mySerial.begin(9600);
}

void loop() {
  int val=analogRead(3); //PA3
  OSCCAL=val/4;
  mySerial.print("Osccal= "); 
  mySerial.println(OSCCAL,HEX);
  delay(200);
}

If you have a frequencee counter you can use the sketch below.
With a attiny84 @ 8MHz it will output 1MHz on pin5, if it is tuned correct.
Again a potmeter is connected to PA3, which will alter OSCCAL.
When you read 1 MHz on the frequence counter, you can read the OSCCAL value on the serial monitor.

Code:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2,3 ); //rx=PB2,tx=PA7 setup of software serial

void setup(){
  mySerial.begin(9600);
  OSCCAL = 0x9F; 
  pinMode(5,OUTPUT);
  noInterrupts(); 
  TCNT1 = 0;
  TCCR1A=0;
  TCCR1B=0;
  TCCR1B |=(1<<WGM12); //Start timer 1 in CTC mode Table 14.4
  TCCR1A |=(1<<COM1B0); //Timer1 in toggle mode Table 14-1
  TCCR1B |=(1<<CS10) ; //prescaler Table 14-5, no prescal
  interrupts();
  OCR1A=3; //CTC Compare value
 }

void loop(){
  int val=analogRead(3); //PA3
  OSCCAL=val/4;
  mySerial.print("Osccal= "); 
  mySerial.println(OSCCAL,HEX);
  delay(200);
}
43  Using Arduino / Microcontrollers / Re: [ATTINY85]Nothing but junk appears on my serial monitor... :( on: February 26, 2014, 03:03:23 pm
Quote
I powered with 3.3volts because today i learned that serial working only under this voltage.

That proves that you should not trust everything you read, it is nonsens.

I don't know the core you are using, as I said in previous post I am using this one:

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

Quote
is there any problem that windows isn't in english language? I think i have tryied everything...

No mine windows is danish, and that dosn't give me any trouble.

Are you using SoftWareSerial for communication ?

44  Using Arduino / Microcontrollers / Re: Erratic behaviour with software serial and eeprom, attiny 84, tinyisp on: February 26, 2014, 02:24:16 pm
Quote
From the knockbang header file It seems that the knockbang is using the ordinary miso on the tiny, so I should get some output even if I don't connect any oscillator on xtal2, right?

Yes that is right.

The the  _TinyISP_BuildOptions should look like this when you are using KnockBang
Remember to comment out  this in the TinyISP
Code:
//#include <SoftwareSerial.h>

Code:
/Set to 1 if using KnockBang and comment out #include <SoftwareSerial.h> in TinyISP
   #define RELAY_KNOCK_BANG_ENABLED 1
 
//Set to 1 if using Serial Relay, and uncomment #include <SoftwareSerial.h> in TinyISP
   //Transmit on Arduino is A0
   #define RELAY_SERIAL_ENABLED  0
 
//Set to 1 if using TinyTuner2

   //Tuning signal pin 3 on UNO, connect to xtal2 on target
   #define TUNING_SIGNAL_ENABLED  1

And rember to set the Serila monitor at 19.200
45  Using Arduino / Microcontrollers / Re: Using ATTiny84 with DS18B20 temp sensor as temperature logger on: February 26, 2014, 01:48:07 pm
You are welcome
Pages: 1 2 [3] 4 5 ... 71