Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: attiny84 Wrong pin mapping on: January 20, 2014, 08:01:14 am
Coding Badly

I have now looked at the link you sent and tested and as always you are correct.

I admit I don't fully understand how addressing the pins D0 to D10 is derived but I assume it's somewhere within the Tiny code.
Where would i find this information in future for other ATTinys?

Lastly I'm using serial for debugging which by default comes out on D0, I have tried various things to move this but again I can't figure this out.
Is this possible?
http://arduino.cc/en/reference/serial



2  Using Arduino / Programming Questions / Re: attiny84 Wrong pin mapping on: January 20, 2014, 02:51:09 am
CodingBadly

Thank you for the reply.

Digital pin 4 would make sense if I saw D4 in any of the references I'm using.
I thought Arduino did all the clever stuff and I could just reference the pic without having to resort to reading and learning  smiley
I was using the following attached files as my reference.


My problems started when I could address PA0 to PA5 but not PA6 & PA7
To test the PCB I had made I used the blink sketch to test each port, (Relay, Piezo, LEDs) I could address PA0 to 5 but not 6 & 7 (6&7 go to a Bipolar LED).

Having just come back to Arduino after a year break I am rusty and tried every variaition to talk to the pins.
In hind sight I  think I have made a bad choice of what pins I use.

Any more pointers would be welcome.

Rob


3  Using Arduino / Programming Questions / Re: attiny84 Wrong pin mapping on: January 20, 2014, 12:44:53 am
Thanks for the responses

This one
https://code.google.com/p/arduino-tiny/downloads/detail?name=arduino-tiny-0150-0020.zip&can=2&q=

4  Using Arduino / Programming Questions / attiny84 Wrong pin mapping on: January 19, 2014, 02:42:15 pm
I moved a working project from attiny85 to the attiny84 as I needed more pins

I downloaded the latest version of the  Arduino Tiny from github
For some reason the pin mapping seems to be wrong. (for me)

E.g Using the following code I would expect PA4 to blink but PA6 does instead.

Is there a logical answer?
I have the correct board selected etc and have burnt the boot loader.

Sorry if this is a stupid question.

Rob

Code:
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 

int led = PA4;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);    
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Moderator edit: [code] [/code] tags added.
5  Using Arduino / General Electronics / Re: Zener Diode affecting Voltage divider on: January 07, 2013, 05:07:18 pm
LarryD

I'll wil have a read and will have a play with your circuit.
Again thanks for taking the time to reply.

Grumpy_Mike

I thought about lower values but thought the values you suggest would draw 50ma which make be a little excess and generate heat.
Also I thought the sweet spot for ADC inputs was 10k?
Or am I wrong?

6  Using Arduino / General Electronics / Re: Zener Diode affecting Voltage divider on: January 07, 2013, 01:07:25 pm
LarryD

Thanks for the reply

I just took one of the Zener's I'm using and put it straight across my bench PSU and it limits dead on 5.1V so I'm happy I'm outside of the knee.

Also just having a poke around again, if I put 12volts into the circuit I would expect to see 4volts at the junction of the 2 resistors.
Without the Zener I see 4volts, but as soon at I put the Zener in circuit it drops to 3.1volts.
I also just swapped the resistors out for 1/2w type in case it was this.

I'm stumped.
7  Using Arduino / General Electronics / Re: Zener Diode affecting Voltage divider on: January 07, 2013, 12:27:47 pm
Sorry this is just a quick sketch to show the divider, assume the pic has power etc please.
I realised I hadn't drawn it correctly in my haste.
8  Using Arduino / General Electronics / Re: Zener Diode affecting Voltage divider on: January 07, 2013, 12:25:07 pm
I guess showing the Zener would be useful, FYI I'm using .4w resistors
9  Using Arduino / General Electronics / Zener Diode affecting Voltage divider on: January 07, 2013, 11:47:44 am
I have a voltage divider measuring  a car battery
Volts +-20k <> 10K - Ground with a ATtiny85 ADC connected to the junction of the 2 resistors. (with a 100nf cap on the input to the ADC to ground)

Everything works fine but I added a 5.1Volt Zener to stop any spikes and this is dragging  /affecting the ADC reading down from 1023 for 15v (5v at the pin) down to 1014 for 15V.
If I remove the zener and just measure the voltage with a fluke scope it also affects the reading, i just tried a basic DVM and this doesn't affect the reading so I am assuming its a capacitive issue rather than the voltage being dragged down.

I've built two prototypes and both do the same.

Has anyone else had a similar issue, I did try searching but couldn't find any answers.

Rob

10  Using Arduino / Programming Questions / Re: ATtiny45 TinyDebugSerial wont compile on: November 26, 2012, 05:53:30 pm
Coding Badly

The Sketch works perfectly, this will certainly save some time.

Thanks for the great work.

Rob
11  Using Arduino / Programming Questions / Re: ATtiny45 TinyDebugSerial wont compile on: November 26, 2012, 05:24:41 pm
Coding Badly

FYI I moved the sketch and it compiled OK, Thanks.
Also the README is Zero Byte
12  Using Arduino / Programming Questions / Re: ATtiny45 TinyDebugSerial wont compile on: November 25, 2012, 06:41:30 am
Coding Badly

Thanks for the reply & this look likes the ideal solution.

I had a read then downloaded the master and dropped it into the library as TinyISP (MAC OSX IDE 1.01)
If I compile I get a lot of errors, before I continue  I assume it works with 1.01?







TinyISP/KnockBangParser.cpp.o: In function `TinyDebugKnockBangParserClass::process()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/KnockBangParser.cpp:51: multiple definition of `TinyDebugKnockBangParserClass::process()'
KnockBangParser.cpp.o:KnockBangParser.cpp:51: first defined here
TinyISP/KnockBangParser.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/KnockBangParser.cpp:51: multiple definition of `TinyDebugParser'
KnockBangParser.cpp.o:KnockBangParser.cpp:51: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::setMode(AispLEDClass::mode_t)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:94: multiple definition of `AispLEDClass::setMode(AispLEDClass::mode_t)'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:94: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::update()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:108: multiple definition of `AispLEDClass::update()'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:108: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::flash()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:77: multiple definition of `AispLEDClass::flash()'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:77: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::error()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:66: multiple definition of `AispLEDClass::error()'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:66: first defined here
TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::begin(unsigned char)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:53: multiple definition of `AispLEDClass::begin(unsigned char)'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:53: first defined here
TinyISP/TinyISP_AispLED.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_AispLED.cpp:94: multiple definition of `StatusIndicator'
TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:94: first defined here
TinyISP/TinyISP_Monitor.cpp.o: In function `monitor_run(unsigned char&)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Monitor.cpp:123: multiple definition of `monitor_run(unsigned char&)'
TinyISP_Monitor.cpp.o:TinyISP_Monitor.cpp:123: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_toggle_hold_in_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:820: multiple definition of `programmer_toggle_hold_in_reset()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:820: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_error_occurred()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:857: multiple definition of `programmer_error_occurred()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:857: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_release_target_from_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:829: multiple definition of `programmer_release_target_from_reset()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:829: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_hold_target_in_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:852: multiple definition of `programmer_hold_target_in_reset()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:852: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_reset_target()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:834: multiple definition of `programmer_reset_target()'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:834: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_toggle_hold_in_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:820: multiple definition of `param'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:820: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_process_command(unsigned char)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:689: multiple definition of `programmer_process_command(unsigned char)'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:689: first defined here
TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_toggle_hold_in_reset()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_Programmer.cpp:820: multiple definition of `programmer_active'
TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:820: first defined here
TinyISP/TinyISP_SPI.cpp.o: In function `spi_begin()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_SPI.cpp:67: multiple definition of `spi_begin()'
TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:67: first defined here
TinyISP/TinyISP_SPI.cpp.o: In function `spi_end()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_SPI.cpp:102: multiple definition of `spi_end()'
TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:102: first defined here
TinyISP/TinyISP_SPI.cpp.o: In function `spi_send':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_SPI.cpp:120: multiple definition of `spi_transaction(unsigned char, unsigned char, unsigned char, unsigned char)'
TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:120: first defined here
TinyISP/TinyISP_SPI.cpp.o: In function `spi_transaction2(unsigned long)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TinyISP/TinyISP_SPI.cpp:183: multiple definition of `spi_transaction2(unsigned long)'
TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:183: first defined here
13  Using Arduino / Programming Questions / Re: ATtiny45 TinyDebugSerial wont compile on: November 24, 2012, 09:23:05 am
Erni

As always thanks for the response.

I found the issue and this may be useful to others.
When I extracted the http://code.google.com/p/arduino-tiny/ I created the directory "hardware" and copied the folder into it and closed and reopened Arduino.
The problem was MAC OSX created a folder called "arduino-tiny-0100-0015" with the Tiny library sat inside (folder name is the zip name)

e.g
hardware/arduino-tiny-0100-0015/arduino-tiny/tiny etc....

However when I restarted  and checked under Tools>Board none of the Tiny Library boards where there.
So I dropped the Library down one level
e.g
hardware/arduino-tiny/tiny etc....

Restarted and now it all works fine.

I assume there is some limit on the amount of directories before Arduino stops looking?

Also for those who get garbled text when they get this working I haven't been able to get any of my Uno or Due boards to display clear text so i have just hooked up and FTDI (USB to Serial board) and it works fine.

Has anybody else had success using the Uno board (pin0) as the RS232 interface?

Enri

Again thanks for the prompt in the right direction.
14  Using Arduino / Programming Questions / ATtiny45 TinyDebugSerial wont compile on: November 24, 2012, 06:56:18 am
I'm having a compiling issue with TinyDebugSerial

I have searched the forums but can't seem to find the answer (this was the closest, http://arduino.cc/forum/index.php/topic,123388.0.html)

I  can get the SoftwareSerial working fine but I can't get TinyDebugSerial to compile.

The error is
tiny_serial:5: error: 'TinyDebugSerial' does not name a type
tiny_serial.cpp: In function 'void setup()':
tiny_serial:9: error: 'mySerial' was not declared in this scope
tiny_serial.cpp: In function 'void loop()':
tiny_serial:15: error: 'mySerial' was not declared in this scope
tiny_serial.cpp: At global scope:
tiny_serial:20: error: function definition does not declare parameters

I have the arduino tiny library installed under hardware and TinyDebugSerial.h is in there
I'm convinced this an error on my MAC rather than an arduino issue.

Can anyone confirm if this compiles please.


The code is this.

#include <TinyDebugSerial.h>
// Definitions
#define rxPin 2
#define txPin 0

TinyDebugSerial mySerial = TinyDebugSerial();

void setup()
{
  mySerial.begin(9600);
}
void loop()
{
   mySerial.print("test");
  delay(1000);
}

15  Using Arduino / Programming Questions / Re: ATTINY45 ADC1 PROBLEM on: November 19, 2012, 12:28:53 pm
Erni

Using the ATtiny support library I'm using you can't define pins as A1,D1 etc just 1,2,etc or PB1,2, etc.

https://github.com/damellis/attiny/tree/Arduino1

So it's my understanding they are defined when you analogRead(1,2,3,4) as per the analogue pinouts below



Like most people here I'm learning as I go, but things I've done with the Uno board don't seem to work with the ATtiny, i just assume the library is not as mature.
Pages: [1] 2