fredericplante / sanguino

Automatically exported from code.google.com/p/sanguino
0 stars 0 forks source link

lack of internal VREF support #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. set using analogReference(INTERNAL1V1)

What is the expected output? What do you see instead?
Should set internal reference, throws an INTERNAL1V1 not defined

What version of the product are you using? On what operating system?
arduino IDE 0022 
sanguino 0023R3 revision
ubuntu 32 bit

Please provide any additional information below.

I think I fixed this by replacing line 64-66 in wiring.h with these
[code]#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || 
defined(__AVR_ATmega644p)    //MY EDITS
#define INTERNAL1V1 2           //Sanguino has Vref shorted to VCC, so internal refs
#define INTERNAL2V56 3          //will toast a generic Sanguino board
[/code]

I also added the following between lines 48 & 49 in wiring_analog.h
[code]#elif defined(__AVR_ATmega644p__)
    if (pin >= 24) pin = 31-pin; //allow for channel or pin numbers         ***MY EDITS 
[/code]

Untested, read my comment in the first fix to guess why

Original issue reported on code.google.com by Vatan....@gmail.com on 7 Aug 2012 at 9:34

GoogleCodeExporter commented 9 years ago
The arduino team fixed this in the 1.0 core but only for the 1284p, I added the 
patches for the 644p to the sanquino version for 1.0 which I should be ready to 
post soon.

For version 0023 use the workaround above ( you will need to use 
__AVR_ATmega644P__ rather than __AVR_ATmega644p__ though )

Original comment by sutt...@gmail.com on 9 Aug 2012 at 1:23

GoogleCodeExporter commented 9 years ago

Original comment by sutt...@gmail.com on 9 Aug 2012 at 1:23