Show Posts
Pages: [1] 2 3 ... 10
1  Using Arduino / Microcontrollers / Re: low power consumption 328p on: January 12, 2014, 02:41:25 pm
Use lowpower library with powerdown-wake up periodic option and you can decrease current to 1-5mka.
2  Community / Products and Services / Re: Low Power Board like Arduino on: January 12, 2014, 02:29:47 pm
What do you mean in "low power"?
Arduino board has FTDI USB-to-serial driver, that consumes lots of power.
So you can choose arduino mini pro board, that comes without ftdi and costs about 2-3USD.
There is also voltage regulator that consumes few microampers.
If you remove this regulator and program mcu to go sleep mode, you'll get about 1mka current consumption.
3  Using Arduino / Programming Questions / Re: Weird Directive ifdef on: November 27, 2013, 11:16:22 am
That magic paragraph from http://www.arduino.cc/en/Hacking/BuildProcess
Quote
Next, the environment searches for function definitions within your main sketch file and creates declarations (prototypes) for them. These are inserted after any comments or pre-processor statements (#includes or #defines), but before any other statements (including type declarations). This means that if you want to use a custom type as a function argument, you should declare it within a separate header file. Also, this generation isn't perfect: it won't create prototypes for functions that have default argument values, or which are declared within a namespace or class.
4  Using Arduino / Programming Questions / Re: Weird Directive ifdef on: November 27, 2013, 10:17:56 am
Thanks for replies. Hope Arduino will work on it, since I just use simple way out (but I've wasted some time trying to figure out what is going on and maybe so did others).
5  Using Arduino / Programming Questions / Re: Weird Directive ifdef on: November 27, 2013, 09:47:04 am
I haven't posted error because it is useless, it just says that compilator misses code after #endif
here is the error
Quote
core.a(main.cpp.o): In function `main':
D:\Arduino\arduino-1.0.5\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to `setup'
D:\Arduino\arduino-1.0.5\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop'

Tried in 1.0.5 version, 1.5.3 version and in onlder 0.22 version, same result.
Error is gone if I put some code before #ifdef
6  Using Arduino / Programming Questions / Weird Directive ifdef on: November 27, 2013, 09:18:05 am
So, here is very simple code, try compile it and you'll get error message
Code:
#ifdef SOMEDEF
  char a;
#endif

void setup() {}
void loop() {}

now lets define SOMEDEF
Code:
#define SOMEDEF 1
#ifdef SOMEDEF
  char a;
#endif

void setup() {}
void loop() {}
error gone!

If you want more strange behave, change variable definition with some other code
Code:
char a;
#ifdef SOMEDEF
 void f()
{
   a='0';
}
#endif

void setup() {}
void loop() {}
error gone again.

another try
Code:
char b;
#ifdef SOMEDEF
char a;
#endif

void setup() {}
void loop() {}
error gone again.

I'm confused. Any suggestions?
7  International / Software / Re: Simulatore Software Arduino on: November 13, 2013, 03:40:06 am
Quote from:  link=topic=125298.msg942153#msg942153 date=1349191504
vbbexpress dovrebbe fare al caso tuo

virtual breadboard l'ultima volta che l'ho provato io non ti faceva caricare qualsiasi cosa, e soprattutto non tutte le librerie erano utilizzabili.

Se proprio non puoi utilizzare proteus, mi sembra di ricordare ci fosse anche un piccola avr emulator da qualche parte.... domattina controllo in ufficio.


Ecco il link

EMULARE 1.9

Hi,  I downloaded the Emulare but seems it doesn't works and there is no updated documentation for new version (since 1.7 version)
Has anybody tried it out?
8  Using Arduino / Microcontrollers / Re: atmega328p internal oscillator setup help on: November 10, 2013, 05:28:26 pm
Here is the solution
http://forum.arduino.cc/index.php?topic=197091.msg1463130#msg1463130
9  Using Arduino / Microcontrollers / Re: hardware folder and bootloader on: November 10, 2013, 05:27:54 pm
Success at least.
There are different architectures support added in IDE, so you need just extra subfolder - avr.
so, everithing is the same except the bootloaders.txt file (see the same file in arduino folder and modify according that) and put this file in extra avr subfolder with own  breadborad sbfolder, so now we have full path
[ArduinoProjects folder]\hardware\avr\breadboard
10  Using Arduino / Microcontrollers / Re: hardware folder and bootloader on: November 10, 2013, 05:15:58 pm
The format of bootloaders file is changed.
here is some information about it
https://github.com/arduino/Arduino/issues/308
https://github.com/arduino/Arduino/blob/8e7133eaaccb2463da22169915d6c4ae5e0ba3bc/hardware/arduino/avr/boards.txt#L62
the processor submenu is added.

I've modified the boards.txt file in [arduino]\hardware\arduino\avr folder and works well, but doesn't succeed with [arduino project]\hardware folder.
11  Using Arduino / Microcontrollers / Re: hardware folder and bootloader on: November 10, 2013, 04:30:06 pm
Same problem, doesn't work in 1.5.* IDEs.
Works well in 1.0.*  IDEs.
12  Using Arduino / Microcontrollers / Re: atmega328p internal oscillator setup help on: November 10, 2013, 04:27:28 pm
The tutorial says that you should put the boards file in arduino projects folder (as hardware subfolder).
But it doesn't works in 1.5.* versions.
Works well with 1.0.* versions.
 Either they changed custom boards setup or just removed this feature.
13  Using Arduino / Networking, Protocols, and Devices / Re: Arduino as I2C slave, how to send less than requested? on: October 30, 2013, 02:08:34 am
Working on atmega doc.
From MR mode description:
Quote
After the last byte has been received, the MR should inform the ST by sending a NACK after the
last received data byte.
So, here they suppose that master should acknowledge slave to stop sending data.

But lets read what is hapennign in ST mode
Quote
If the TWEA bit is written to zero during a transfer, the TWI will transmit the last byte of the transfer.
State 0xC0 or state 0xC8 will be entered, depending on whether the Master Receiver
transmits a NACK or ACK after the final byte. The TWI is switched to the not addressed Slave
mode, and will ignore the Master if it continues the transfer. Thus the Master Receiver receives
all “1” as serial data. State 0xC8 is entered if the Master demands additional data bytes (by
transmitting ACK), even though the Slave has transmitted the last byte (TWEA zero and expecting
NACK from the Master).
That is easy to misunderstood what is happening here, especially this: "even though the Slave has transmitted the last byte (TWEA zero and expecting NACK from the Master)", what does it means? Setting TWEA zero does affects the bus somehow?

I think TWEA doesn't means to affects bus all the times, it depends on working state and it just enables twi hardware to ack it oly in some cases. But the same time TWEA affects twi process inside, not on the bus, as self control instrument.

Now look in MT. here everything almost the same (one side sends data and receives ack/nack) except the ending of transmission, now sender ends transmission via sending stop/start condiotion
Quote
This scheme is repeated until the last byte has been sent and the transfer is ended by generating
a STOP condition or a repeated START condition.
If ST could sent STOP to MR ...
14  Using Arduino / Networking, Protocols, and Devices / Re: Arduino as I2C slave, how to send less than requested? on: October 29, 2013, 03:37:21 pm
I wouldn't change the class. Isn't this just a message protocol on top of it?
Not just message, there are data packages to be transferred regarding are they updated or not, master doesn't knows amount of updated data and just ask for maximum data size. If I doesn't change the library, I should process data receive at master with interrupt, not with requestFrom.

Quote
I've had another look at the docs, and despite what the datasheet says, I can't see how the slave sender can send an ACK/NAK while at the same time (and for the same bit) the master receiver replies ACK/NAK. They can't both be doing it.
That is what I talk about, I'm confused reading docs.
ACK pulls down the SDA and there is no way for another side to pull it up the same time.
I should read another model, MT -> SR , maybe things become more clear.
15  Using Arduino / Networking, Protocols, and Devices / Re: Arduino as I2C slave, how to send less than requested? on: October 29, 2013, 03:23:30 pm
Quote
so if you requested 10 bytes, you just can loop through rx buffer 10 times via FOR statement not WHILE, without checking available().

Wire.requestFrom returns the number of bytes received. You don't need to loop like that.

However I guess your argument is that it will always return the number of requested bytes, regardless of what the slaves sends.
exactly smiley only communication error may change that.
Pages: [1] 2 3 ... 10