Show Posts
Pages: [1] 2
1  Using Arduino / Microcontrollers / Re: Stops at 1778 bytes without errors on: January 01, 2014, 04:54:53 pm
Thanks for your response mrburnette.
Issue was way simpler than that, there have been some years since i last used arduino, and have forgot alot of things. Among them using a integrer when picking up a state. I had them like this "digitalRead(dittobutton)" instead of "dittostate = (digitalRead(dittobutton)"... It sure did seem like it helped to fix this issue, i will have another test with the board now. Anyways, if anyone have some suggestions to changes to the script that is better let me know
2  Using Arduino / Microcontrollers / Stops at 1778 bytes without errors on: January 01, 2014, 02:37:52 pm
Hello all.

First off, i wish everyone a happy new year!

For the last years i have been developing a amplifier, and now im in the final stages creating the MCU unit that consists of a Arduino Mega board with a lot of (amplifier)safety features connected to it. Now, there is nothing wrong with the board it self, the error lays in my programming skills so i hope someone would be so kind to help me fix this issue. For some reason when im verifying the program, it ends up finished with a result of: Binary sketch size: 1 778 bytes
However, there is no way that this size is correct, and it does not function on the arduino unit at all. Ive created a smaller program just to do a check, with this simple program everything is running as it should(although no security features is actived with that program) and even this program is bigger around 2200 bytes.

Check the file attached to this post, if was to big to be pasted here.

Anyone have some input for me? Thanks.
3  Using Arduino / LEDs and Multiplexing / Re: using optocouplers to give pwm signal on: July 23, 2012, 11:11:21 am
Aha. Nice, ill try that :-)
4  Using Arduino / LEDs and Multiplexing / Re: using optocouplers to give pwm signal on: July 22, 2012, 12:40:36 pm
Runaway Pancake:

Yes, thats what i had in mind, but how would it be to code this?



DuaneB:

Yes, that could be useful also.

Could it be done like this;
On the board that should send the message;
digitalWrite(failout,HIGH);
delay(10);
digitalWrite(failout,LOW);

and then on the receiver:
duration = pulseIn(failin, HIGH);
if (duration = 10) { do this and that }

or

if (failout == HIGH) {
    duration = pulseIn(failin, HIGH);
if (duration = 10) { do this and that }
}

What do you think? smiley
5  Using Arduino / LEDs and Multiplexing / Re: using optocouplers to give pwm signal on: July 22, 2012, 03:08:12 am
Its 2 different earthpoints, that cannot be connected together, so they should be electronically isolated from each other.

For an optocoupler i meant a DIP device yes...
6  Using Arduino / LEDs and Multiplexing / using optocouplers to give pwm signal on: July 21, 2012, 12:10:54 pm
Hello All!

Not sure if this is the correct spot for my question, but here it comes;

I need to give error or OK messages without any connection between two arduinos, but could i do it using a optocoupler?

I mean, running a pwm signal of 200 into the optocoupler, would it pwm out 200? So that if something went wrong on one board, it could just run a pwm of 200, and the other board then would read the 200 pwm and give an error message of "low voltage" for example?

If this where not such a good idea, do you have something else to suggest?

Thanks
7  Using Arduino / Programming Questions / Re: run command if analog read is within 2 values on: July 04, 2012, 11:41:25 am
Aha. Nice.

Thanks smiley-grin
8  Using Arduino / Programming Questions / run command if analog read is within 2 values on: July 03, 2012, 02:46:34 pm
Hello All!

I need to run a command, only if an analog pin is giving a value within f.ex. 600 and 700, or else run another commando. How do i do this in the easiest way? (the else part i know..)
9  Development / Suggestions for the Arduino Project / Re: Programming ATtiny861 with Arduino on: June 29, 2012, 11:04:53 am
Okey. Yeah, i saw there where some intrest there, but very little it seems. Would be great if you could add support for it.

No special reason, its the only SOIC chip i have on hand from ATtiny series, as a couple of it for a great price a while back.. But then i have to ask, why not? smiley-razz
I do also have some ATmega328`s but its PDIP, but i guess it gonna have to work for a while.

I did notice somewhere here support for ATtiny26 on 8mhz internal clock, but that one would not work for 61 series?
10  Development / Suggestions for the Arduino Project / Programming ATtiny861 with Arduino on: June 28, 2012, 12:43:37 pm
Hello!

Not sure if this where the right place to put it, but:
I see that one can program ATtinyX4 ATtinyX5 and some other tiny chips, but is it possible to do it with ATtinyX61? Could not find it anywhere..
11  Using Arduino / Audio / Re: Im having trouble communicating to a PGA2310 chip on: February 04, 2011, 02:46:33 am
Okey then.

Thanks smiley
12  Using Arduino / Audio / Re: Im having trouble communicating to a PGA2310 chip on: February 03, 2011, 08:26:00 am
Found a new code for it: http://code.google.com/p/dccn-lab/source/browse/trunk/audiovolume/Arduino/pga2311_volume_control/pga2311_volume_control.pde?r=59
This one seems to be working good.

I also breadboarded the project a little more professional, should SDI, CLK, CS, ZCEN, MUTE have pulldown and pullup resistors?
Atleast, now i am using:
SDI: 100k pulldown
CLK: 100k pullup
CS: 100k pulldown
ZCEN: 47k pulldown
MUTE: 47k pulldown
13  Using Arduino / Audio / Re: Im having trouble communicating to a PGA2310 chip on: February 02, 2011, 08:45:20 pm
Maybe this post belongs under "Programming Questions", could a moderator move it for me if so?
14  Using Arduino / General Electronics / Re: Voltage divider: Separate GND on: February 02, 2011, 07:23:12 pm
Thank you all.

hall-effect current sensor sounds very interesting, maybe ill try one like that.
Yes, it is for a power amplifier
15  Using Arduino / Audio / Im having trouble communicating to a PGA2310 chip on: February 02, 2011, 07:15:34 pm
Hi all!

Im working on a volume controller, based on Texas Instrument`s PGA2310 Digital volume-controller chip, but im having some trouble making it work at all.
Here is how my code looks:
Quote
#include "SPI.h"

const int PGA_CS_PIN = 48;
const int PGA_SCLK_PIN = 52;
const int PGA_SDI_PIN = 51;

int timedelay = 100;
int volumeLevel = 55;

void setup() {
pinMode(PGA_CS_PIN,OUTPUT);
pinMode(PGA_SCLK_PIN,OUTPUT);
pinMode(PGA_SDI_PIN,OUTPUT);
digitalWrite(PGA_CS_PIN,HIGH);
digitalWrite(PGA_SCLK_PIN,HIGH);
digitalWrite(PGA_SDI_PIN,HIGH);
Serial.begin(9600);
}

void PGA_set_volume(byte value)
{
 byte shifted_val = (value << 1);   
digitalWrite(PGA_CS_PIN, LOW); // assert CS
SPI_write(shifted_val); // right value (0..255)
SPI_write(shifted_val); // right value (0..255)
digitalWrite(PGA_CS_PIN, HIGH); // deassert CS
Serial.print(shifted_val);
}

static inline void SPI_write(byte out_spi_byte)
{
byte i;
// loop thru each of the 8-bits in the byte
 for (i=0; i < 8; i++) {
// strobe clock
digitalWrite(PGA_SCLK_PIN, LOW);
// send the bit (we look at the high order bit and 'print' that to the remtoe device)
if (0x80 & out_spi_byte) // MSB is set
digitalWrite(PGA_SDI_PIN, HIGH);
else
digitalWrite(PGA_SDI_PIN, LOW);
// unstrobe the clock
digitalWrite(PGA_SCLK_PIN, HIGH);
out_spi_byte <<= 1; // left-shift the byte by 1 bit
}
}

void loop()
{
// Reset the volumeLevel if it goes over 128. I think it can actually go to 255.
//if (volumeLevel > 254) {
//volumeLevel = 1;
//}
// Set the volume
PGA_set_volume(volumeLevel);
delay(timedelay);
volumeLevel = volumeLevel + 1;
}

And using the serial communication too see what the arduino says to the chip, this is what comes:
Quote
 "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~€‚„†ˆŠŒ

I have no idea why this happens, Ive just started with arduino so im basically an extremely newbie... :o

Some of this code comes from what linux-works once posted, basically its the only thing i can find, except linux-works PGA23XX library witch i dont now how works.

Can some one help sort this out?

Thanks,
Stian
Pages: [1] 2