ATtiny841 core - testers wanted

And there is a warning for bad vectors...

sketch_jun15a.ino: In function 'void X_vect()':
sketch_jun15a.ino:3:5: warning: 'X_vect' appears to be a misspelled signal handler [enabled by default]

jboyton:
It would have saved me a little head scratching if the compiler had said "not a recognized interrupt vector" or something like that. Got to be careful about typos.

If you are using IDE 1.6.x you can modify platform.txt so warnings are emitted. I believe platform.local.txt can be used to change the recipes without fear of your work being overwritten with an update.

[quote author=Coding Badly link=msg=2277486 date=1434400685]
If you are using IDE 1.6.x you can modify platform.txt so warnings are emitted.[/quote]
What do you change? I tried editing several fields and it had no effect. But I have to admit I don't know what I'm doing.

I assume you are using this core...

Basically, you remove "-w"...

The complete version...

You know, when I installed that core I wasn't sure about the instruction to use platform_162.txt if I was using IDE 1.6.2. Did that mean 1.6.x? Or really just 1.6.2? I'm using 1.6.4 so I left the platform.txt as is.

You pointed me to the 1.6.2 platform.txt. So should I be using that one instead?

Both work on 1.6.4.

The 1.6.2 version only works with 1.6.2 and later.

Other version works with all 1.6.x versions except 1.6.2.

I recommend using the normal version for all versions except 1.6.2.

Okay.

Are these the relevant lines in the file?
I tried editing them but didn't get the desired effect.

compiler.warning_flags=w
compiler.warning_flags.none=-w
compiler.warning_flags.default=-warn-unresolved-symbols
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra

compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections

jboyton:
I tried editing them but didn't get the desired effect.

Just replace your .../hardware/tiny841/avr/platform.txt with this:

jboyton:
Okay.

Are these the relevant lines in the file?
I tried editing them but didn't get the desired effect.

compiler.warning_flags=w

compiler.warning_flags.none=-w
compiler.warning_flags.default=-warn-unresolved-symbols
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra

compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections

Those lines are not present in platforms.txt for my core - you are editing some other platforms.txt in some other location!

DrAzzy:
Those lines are not present in platforms.txt for my core - you are editing some other platforms.txt in some other location!

Yes, I just figured that out. I was editing the one under Arduino.app. Sorry about the confusion.

It works now... (sheepish)

I tested SoftwareSerial on an ATtiny841. I tried three different baud rates and changed the system oscillator frequency by tuning the internal 8MHz oscillator calibration registers. What I found was that SoftwareSerial seemed to work at these frequencies:

9600: 7.5-8.5 MHz
19.2: 7.9-8.6 MHz
38.4: 7.6-7.7 MHz

This seemed weird since I'd only recently tested an Atmega328 and the results were different. I finally came to realize that SoftwareSerial had undergone a change with 1.6.x IDE. It appears to have been an improvement. The 1.6.x 841 core uses the older 1.0.x SoftwareSerial.

Using the 1.6.x SoftwareSerial I got these values:

9600: 7.6-8.4 MHz
19.2: 7.6-8.3 MHz
38.4: 7.8-8.2 MHz

The frequencies aren't highly precise because the internal oscillator has a lot of jitter. But the ranges where it worked were better centered around 8Mhz with the 1.6.x version. Also, the 1.6.x SoftwareSerial is 306 bytes smaller in code size. It uses only 3 bytes extra RAM.

I copied SoftwareSerial.cpp and .h into my hardware/arduino-tiny-841 folder. But rather than have this duplication, is there any way to set up the core so that the SoftwareSerial library in the 1.6.x core is used instead?

jboyton:
I copied SoftwareSerial.cpp and .h into my hardware/arduino-tiny-841 folder. But rather than have this duplication, is there any way to set up the core so that the SoftwareSerial library in the 1.6.x core is used instead?

Wait for me to close the issue, and resync :wink: (you just need to replace the softwareserial files in the library folder for the core - 1.6.x will not load Wire, SPI, or SoftwareSerial from the default core when building for a different core. This "feature" is part of the new board management (dys)functionality)

I wonder whether the old one works better on old compiler versions? If so, that would neatly explain all the problems people have with tiny's and software serial recently. I'll bet the same problem is present in the other tiny core I maintain.

DrAzzy:
I wonder whether the old one works better on old compiler versions?

I don't know why it would. But there are other discrepancies that I also don't understand.

For example, I got the same frequency ranges when testing the 841 and 328 with the new SoftwareSerial version. But with the old version the frequency ranges were different. The 328 needed be a little slower at the higher baud rates. There's nothing in the code and nothing about the chips themselves (that I can think of) to account for this. I wish I knew what it was.

The old SoftwareSerial version has an ASM timing loop and a big table of delay values with an entry for each baud rate and a different table for each CPU frequency. The new version uses delay_basic.h and some arithmetic to replace those tables.

An assembly listing quickly showed that the identical SoftwareSerial source code generated very different instructions. The Atmega328 version was compiled in IDE 1.0.6 and the ATtiny841 version in IDE 1.6.4. There were a surprising number of differences. An "inline" directive was ignored for one but followed for the other. All of these add up when the code is tailored for very specific execution timing.

If I change the compiler optimization options will it affect the timing of SoftwareSerial?

I've updated the core - hopefully you should be able to do a clean resync and the core should use the new software serial.

Let me know if I managed to mess this one up, and how well the new one works

I've just commited a major update to boards.txt, that takes advantage of the new submenu features, so now you select "ATtinyx41" from the menu, and can choose the clock, bod, and chip from their own submenus in the tools menu.

Feedback welcome and encouraged :slight_smile:

hello everyone
i order a few 841 and 441 to test (arrive on thuesday)
i'm preparing my IDE to handle them, hope they work good.

FEEDBACK: in IDE 1.6.5 in the right bottom corner there is a text with the options selected "ATtiny841(optiboot),8mhz(internal),Disable on COM1" it could be "ATtiny841(optiboot),8mhz(internal),B.O.D. Disable on COM1"

another point, this suport 441 also(chaging signature)? i never developed an core, so if is lame question, sorry!
EDIT: finally the IDE suport (at least name it, HW to test) the 441

Thanks, will correct that so it's more clear. I hadn't considered how the text showed up.

You might have to add an avrdude.conf entry for the 441. If you do, i think it's just a copy-paste job from the 841.

(also, I'm going to do that on my ATTiny(everything not x41,1634, or x28) core, which will benefit far more than this core does from it)

I just committed a bunch of changes to add support for the '828. This is currently untested, but the boards will sitting on my doorstep when I get back tomorrow.

Please be on guard for regressions and let me know ASAP.

hello
So i get my attiny841 and 441.
the 841 is perfect, but 441 in IDE there is some insues

using DrAzzy core from gethub

get error when try to upload the bootload using arduino uno as IDE
get the "can't find avrdude tool" error
i attach an print from the toll drop menu!
it happens also in the 841, so its for the codding of this drop down menu, if you selected board = 841optiboot direct its perfect

SOLVED
done this " If YOU ARE USING ARDUINO VERSION 1.6.2 (not 1.6.3 or later, nor 1.6.1 or earlier), delete platform.txt and rename platform_162.txt to platform.txt"

but in IDE1.6.5

now is just signature error
SOLVED:
Locate avrdude.conf - typically in C:\Program Files (x86)\Arduino\tools\avr\etc
look for

Try the AT90S2313 devcode:

##avr910_devcode = 0x20;
signature = 0x1e 0x93 0x15;
reset = io;
chip_erase_delay = 4500;

replace

Try the AT90S2313 devcode:

##avr910_devcode = 0x20;
signature = 0x1e 0x92 0x15;
reset = io;
chip_erase_delay = 4500;

error:
cant find empty_all.hex

SOLVE
go to C:\Users\xpto\Documents\Arduino\hardware\arduino-tiny-841-master\avr\bootloaders\empty
copy the existing file (empty.hex) and rename the copy to empty_all.hex

now you have an 441

see you around