funny A/D channel readings with Bobuino-1284 ???

AAMOF, I had already looked at that, but must have been in 1.0 only. However, my sketch
from last time gives me exactly the same results with both IDE 1.0 and 1.03. Likewise
for ERW 1.03. Go figure.

Have you tried running my sketch from last time? Maybe something is weird there.

IDE 1.0

int analogRead(uint8_t pin)
{
uint8_t low, high;

#if defined(AVR_ATmega1280) || defined(AVR_ATmega2560)
if (pin >= 54) pin -= 54; // allow for channel or pin numbers
#elif defined(AVR_ATmega32U4)
if (pin >= 18) pin -= 18; // allow for channel or pin numbers
#else
if (pin >= 14) pin -= 14; // allow for channel or pin numbers
#endif

IDE 1.02

int analogRead(uint8_t pin)
{
uint8_t low, high;

#if defined(AVR_ATmega1280) || defined(AVR_ATmega2560)
if (pin >= 54) pin -= 54; // allow for channel or pin numbers
#elif defined(AVR_ATmega32U4)
if (pin >= 18) pin -= 18; // allow for channel or pin numbers
#elif defined(AVR_ATmega1284P) || defined(AVR_ATmega644P)
if (pin >= 24) pin -= 24; // allow for channel or pin numbers
#else
if (pin >= 14) pin -= 14; // allow for channel or pin numbers
#endif

IDE 1.03

int analogRead(uint8_t pin)
{
uint8_t low, high;

#if defined(AVR_ATmega1280) || defined(AVR_ATmega2560)
if (pin >= 54) pin -= 54; // allow for channel or pin numbers
#elif defined(AVR_ATmega32U4)
if (pin >= 18) pin -= 18; // allow for channel or pin numbers
#elif defined(AVR_ATmega1284P) || defined(AVR_ATmega644P)
if (pin >= 24) pin -= 24; // allow for channel or pin numbers
#else
if (pin >= 14) pin -= 14; // allow for channel or pin numbers
#endif

Have you tried running my sketch from last time? Maybe something is weird there.

Well I seem to be straighten out finally. What I was fighting I guess is a older or different version of maniacbug's hardware files setup for the sanguino/644P chip which I had downloaded and modified to use the bobuino pins_arduino.h, added a optiboot bootloader file for the 644P, etc.

However there seems to be too many differences between some of the hardware core files between the two different maniacbug's hardware folder I had downloaded and installed. So I dumped all the sanguino hardware folders and just added a new bobuino 644P/optiboot board to the maniacbug-mighty-1284p hardware folders. Then I added your suggested fix to the pins_arduino.h and then recompiled/uploaded the various analog test sketches and all is well in bobuino 644P land for me now, yea.

Thanks for your help, I had never actually tested out my analog pins for this bubuino/644P setup (just like Bob I guess :wink: ) so it's good to have that checked off. Still waiting for my 1284P chip to show up, I hope it has at least crossed the international date line by now.

Lefty

Yeah, still doesn't explain, that I can see, the funny business about

#elif defined(AVR_ATmega1284P) || defined(AVR_ATmega644P)
if (pin >= 24) pin -= 24; // allow for channel or pin numbers

I don't know about Sanguino or 644, as they're not included with the maniacbug mighty-1284P-master
files. The files and bootloaders I have are all dated 23 June 2012.

Besides the digital and analog pins, I also checked the PWM pins today with analogWrite(), and
they all look ok, so I think only the analogPinToChannel(p) declaration was wrong.

I just bought some 1284P chips from digikey today, and should arrive on thursday. Yours
are no doubt cheaper, but I want to get this darn thing wrapped up already. Sheesh. Thursday,
I can check the RX0 sensitivity/download problem using the 1284P chips.

On a brighter note, today, my local Coopers hawks returned to their nest in the nearby tree
from their winter sojourn. One can only imagine where they've been all winter since they
left in the fall after their kids had grown. Probably in San Diego, sitting on the beach.

On a brighter note, today, my local Coopers hawks returned to their nest in the nearby tree
from their winter sojourn. One can only imagine where they've been all winter since they
left in the fall after their kids had grown. Probably in San Diego, sitting on the beach.

Well for us that means the hawk population will probably start to dwindle to 1/4 of what we see in the winter as they leave for the north. We have local hawks (mostly red-tails) that are year around.

If your ever interested in populating any of your boards with a 644P chip, here is the boards.txt entry I setup.

##############################################################


bobuino644.name=Bobuino 644P optiboot
bobuino644.upload.protocol=arduino
bobuino644.upload.maximum_size=63488
bobuino644.upload.speed=115200
bobuino644.bootloader.low_fuses=0xff
bobuino644.bootloader.high_fuses=0xdc
bobuino644.bootloader.extended_fuses=0xfd
bobuino644.bootloader.path=optiboot
bobuino644.bootloader.file=optiboot_atmega644p-4-5.hex
bobuino644.bootloader.unlock_bits=0x3F
bobuino644.bootloader.lock_bits=0x0F
bobuino644.build.mcu=atmega644p
bobuino644.build.f_cpu=16000000L
#bobuino644.build.core=arduino:arduino
bobuino644.build.core=standard
bobuino644.build.variant=bobuino

##############################################################

Still waiting for my 1284P chip to show up, I hope it has at least crossed the international date line by now.

Is Mouser shipping these from overseas now?
With >1700 in stock you'd think they'd arrive pretty quick.

CrossRoads:

Still waiting for my 1284P chip to show up, I hope it has at least crossed the international date line by now.

Is Mouser shipping these from overseas now?
With >1700 in stock you'd think they'd arrive pretty quick.
http://www.mouser.com/ProductDetail/Atmel/ATMEGA1284P-PU/?qs=sGAEpiMZZMtVoztFdqDXO3QpeG9FlGm9

Call me a cheapskate but when I click on buy I get this total:

MERCHANDISE TOTAL:
$8.71
SHIPPING CHARGE:
$20.00
ORDER TOTAL:
$28.71

That sounds nuts to me?

So I ordered from Futurlec for like $10 including shipping. I was aware that they take a long time shipping as I've ordered a couple of things from them before in the past, and being retired I'm almost never in a hurry. And because of being able to use a DIP 644P in your same Demu through hole 1284P board you sold me, it's not been non-constructive time spent waiting.

Besides you now have the option of calling your board a 644P/1284P board. :wink:

Lefty

I always use USPS Priority Mail shipping from digikey and mouser and jameco, and with the order
I placed yesterday with digikey, the shipping is $4.91. Priority usually takes 2 days to the west
coast. Mouser is a little cheaper than digikey for small quantities, but only digikey had some other
parts I needed for this order.

I also ordered a few atmega32A chips to play with. From what I can tell, these have the same
pinout as 644/1284, but are essentially a 328 in DIP40, so you get a -UNO with 40-pins. Also
2/3 cheaper than the 644/1284. I don't know if there is a bootloader for the 32A, however.

I should have ordered some 644s too, just to play, but forgot.

oric_dan:
I always use USPS Priority Mail shipping from digikey and mouser and jameco, and with the order
I placed yesterday with digikey, the shipping is $4.91. Priority usually takes 2 days to the west
coast. Mouser is a little cheaper than digikey for small quantities, but only digikey had some other
parts I needed for this order.

I also ordered a few atmega32A chips to play with. From what I can tell, these have the same
pinout as 644/1284, but are essentially a 328 in DIP40, so you get a -UNO with 40-pins. Also
2/3 cheaper than the 644/1284. I don't know if there is a bootloader for the 32A, however.

So what was the

SHIPPING CHARGE:
$20.00

That Mouser showed me when I clicked on buy it? Is the default hand delivery by limousine? Or some kind of minimum order size hidden as a shipping charge?

Lefty

Those guys have a dozen or more shipping options, with Fedex overnight at the top of the
cost structure, and Fedex or UPS ground near the bottom [and which may take a week].
A guy like you [!!!] should avoid clicking on the upper lines.

$4.99 residential shipping is what I normally see with Mouser. $6.99 for bulkier stuff.

oric_dan:
Those guys have a dozen or more shipping options, with Fedex overnight at the top of the
cost structure, and Fedex or UPS ground near the bottom [and which may take a week].
A guy like you [!!!] should avoid clicking on the upper lines.

But I didn't, I just clicked buy it and that is what popped up. I didn't even go to further screens to see if I had a choice of shipping options. So they in effect 'scared me away' by their choice to default to a or the most costly shipping method. If that had not stated any shipping cost then I might have adventured further into the buying process/screens, to see that options they made available. Just poor web design in my opinion.

Lefty

Looks pretty darn easy to me. I looked at my Mouser cart from yesterday [order not
completed], but once I click on "Checkout" from the cart, it takes me to a succession
of screens [notice the top line], then 3rd screen is here,

CHECKOUT» Addresses» Shipping Method» Payment» Review
Shipping Method
Please select one of the following:

Shipping cost determined at the time of shipment.

UPS Ground
UPS 3rd Day
UPS 2nd Day
UPS Next Day Saver
UPS Next Day
UPS Next Day Early AM
FedEx Ground
FedEx 3rd Day
FedEx 2nd Day
FedEx Standard Overnight
FedEx Priority Overnight
FedEx Priority Overnight Early AM
US Postal Service Priority Mail w/Delivery Confirmation

Live wild.

oric_dan:
Looks pretty darn easy to me. I looked at my Mouser cart from yesterday [order not
completed], but once I click on "Checkout" from the cart, it takes me to a succession
of screens [notice the top line], then 3rd screen is here,

CHECKOUT» Addresses» Shipping Method» Payment» Review
Shipping Method
Please select one of the following:

Shipping cost determined at the time of shipment.

UPS Ground
UPS 3rd Day
UPS 2nd Day
UPS Next Day Saver
UPS Next Day
UPS Next Day Early AM
FedEx Ground
FedEx 3rd Day
FedEx 2nd Day
FedEx Standard Overnight
FedEx Priority Overnight
FedEx Priority Overnight Early AM
US Postal Service Priority Mail w/Delivery Confirmation

Live wild.

You seem to miss my point. They don't leave the shipping cost as a blank when I first hit buy it for a $8 DIP chip, put rather it displayed a $20 shipping cost that didn't even mention the shipping method or that other shipping methods are avalible further into the checkout process. That's pretty dumb of them and just a poor marketing design, and that was my point. Most mail order companies offer shipping choices as Mouser does, I just choose to not go further into the buying process.

Lefty

I think you must have clicked on the famous Twilight Zone button.

oric_dan:
I think you must have clicked on the famous Twilight Zone button.

Just the link Bob posted, give it a try.

CrossRoads:

Still waiting for my 1284P chip to show up, I hope it has at least crossed the international date line by now.

Is Mouser shipping these from overseas now?
With >1700 in stock you'd think they'd arrive pretty quick.
http://www.mouser.com/ProductDetail/Atmel/ATMEGA1284P-PU/?qs=sGAEpiMZZMtVoztFdqDXO3QpeG9FlGm9

Lefty

I don't see that shipping is shown until after the address entry page, and then the list of shipping options appears to pick from.

CrossRoads:
I don't see that shipping is shown until after the address entry page, and then the list of shipping options appears to pick from.

That's what I found too, lefty's in the Twilight Zone.

Tried it again and got same results, but that's OK, I can handle 'special treatment' by Mouser. :smiley:

Lefty

Try a different name, maybe "righty".