Tiny Core 2 + ATtiny861

No. I have ver .015 installed, I am unsure about how to proceed... I HATE to ask for hand holding type guidance but I LOVE the tiny cores and yours is the greatest... It's not only well supported but I learn something every time I use them...
Waaah.. I want to upgrade and I'm somewhat confused about the disposition of the 015 cores/ I really appreciate all that's been done and contributed to the use of the cores.

Doc

Docedison:
No. I have ver .015 installed, I am unsure about how to proceed... I HATE to ask for hand holding type guidance but I LOVE the tiny cores and yours is the greatest... It's not only well supported but I learn something every time I use them...
Waaah.. I want to upgrade and I'm somewhat confused about the disposition of the 015 cores/ I really appreciate all that's been done and contributed to the use of the cores.

Doc

The Tiny Core 2 is still under development so you should continue to use 015 unless you want to get involved with the development.

leo72:
Is there an option to move millis to timer 1, like on the actual Tiny core?

There is now. Instructions...

• Download the update...
http://arduino-tiny.googlecode.com/files/tiny-core-2-0100-0002.zip

• Navigate to the {SketchbookFolder}/hardware/tiny2/variants/ directory

• Create a new folder named leo72

• Navigate to the standard ( {SketchbookFolder}/hardware/tiny2/variants/standard/ ) directory

• Select and copy the tc_build_options.h file

• Navigate to the leo72 ( {SketchbookFolder}/hardware/tiny2/variants/leo72/ ) directory

• Paste the tc_build_options.h file into the leo72 directory

• Open the tc_build_options.h file in your favourite text editor

• Locate the following section, remove the comment from the #define, save the file, close the text editor

/*=============================================================================
  Which timer should be used for millis
=============================================================================*/

#define TC_TIMER_TO_USE_FOR_MILLIS  1

• Navigate to the {SketchbookFolder}/hardware/tiny2/ directory

• Open the boards.txt file in your favourite text editor

• Locate a ATtiny861 board entry that most closely matches the settings you want. For example, I will be working with the attiny861at8 entry.

• Select and copy the entire board entry

• Navigate to the bottom of the file and paste

• Change the the keyword of the new section to something unique. For example, I changed attiny861at8 to leo72.

• Change the board name to something descriptive. For example, I changed u ATtiny861 @ 8 MHz (internal oscillator; BOD disabled)[/u] to Leo's Test.

• Change the BOARD.build.variant value to leo72. For example, I changed leo72.build.variant=standard to leo72.build.variant=leo72.

• This is my complete example...

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

leo72.name=Leo's Test

#------------------------------------------------------------------------------#
# The following programmers DO work (pick one)...
#

leo72.upload.using=arduino:arduinoisp

#  leo72.upload.using=arduino:usbtinyisp
#  leo72.upload.protocol=avrispv2
#  leo72.upload.using=pololu
#------------------------------------------------------------------------------#

#------------------------------------------------------------------------------#
# The following programmers do NOT work...
#  leo72.upload.using=avrispv2
#  leo72.upload.using=Pololu USB AVR Programmer
#------------------------------------------------------------------------------#

#------------------------------------------------------------------------------#
# Fuse settings and processor speed...
#
# Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value
# 
# Brown-out detection disabled; [BODLEVEL=111]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]
# Serial program downloading (SPI) enabled; [SPIEN=0]

leo72.bootloader.low_fuses=0xE2
leo72.bootloader.high_fuses=0xD7
# The extended fuse always reads back as 0x01 on my ATtiny861.  Only bit 0 is defined so we'll just use 0x01.
# leo72.bootloader.extended_fuses=0xFF
leo72.bootloader.extended_fuses=0x01
leo72.build.f_cpu=8000000L

# rmv leo72.bootloader.path=empty
# rmv leo72.bootloader.file=empty85at8.hex
# rmv? fix? leo72.bootloader.unlock_bits=0xFF
# rmv? fix? leo72.bootloader.lock_bits=0xFF
leo72.build.mcu=attiny861
leo72.upload.maximum_size=8192
leo72.build.core=tiny
leo72.build.variant=leo72
# leo72.build.core=empty

#------------------------------------------------------------------------------#
# From the factory values (for reference)...
#  avrdude: Device signature = [fix]
#  avrdude: safemode: lfuse reads as 62
#  avrdude: safemode: hfuse reads as DF
#  avrdude: safemode: efuse reads as 01
#------------------------------------------------------------------------------#

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

• Save the file and close the text editor

• Start the Arduino IDE

• Ensure the new board is selected

• Execute Tools / Burn Bootloader to ensure the fuses are correct

• Enjoy!

Erni:
The tuned frequence was 1.194 MHz !

Excellent!

Besides the other improvements of TinyTuner you mention, I think the biggest advantage is that it can be used with TinyDebugKnockBang.
No more fidling with Serial/USB converter and wiring.

No doubt!

Once again Thankyou for maintaining and improving the Tiny core

You are welcome.

I even have an EEPROM address range in mind for configuration data. If you're interested just let me know. ... I am interested

The header file of interest is tc_eeprom_config.h.

Most (all?) folks start at address zero and work towards the end of EEPROM. In an attempt to avoid conflicts, I am working the other direction; from the end of EEPROM towards address zero. The address of each configuration item is expressed as an offset from the end of EEPROM. I will use this as an example...

const uint16_t TC_EEPROM_CONFIG_1V1_REFERENCE_O         = (E2END - 11);

Address (E2END - 11) is used to store the 1.1 volt reference voltage for that processor. The value is a single byte so this line of code could be used to read the value...

uint16_t ReferenceVoltageX1000 = eeprom_read_byte( (const uint8_t *) TC_EEPROM_CONFIG_1V1_REFERENCE_O ) + 1000;

If ReferenceVoltageX1000 is equal to 1255, a value is not available.

I have space reserved for three OSCCAL values (the clock divider makes a difference), three numerators (for "super tuning"), a processor ID (for networking and tracking), and the 1.1 volt reference.

As I have time, I will round out the helper functions in that header file (for example, tcReadEepromConfig1(uint16_t) is missing).

sej7278:
i've installed the core into the hardware directory, made a boards.txt using the attiny85at8 option, and ran my previous-working sketch through the IDE and it came back with this lot:

Thank you for the feedback.

is the '85 support not ready or do i have to do something with one of the buildoptions header files?

Complete support is not ready for any processor.

P.S. will this core allow the third PWM pin like 0017 does? bloody marvellous feature that is BTW :grin:

It will when I finish the veneer for timer 1 on the t85 processor. (I'm glad to know you like it.)

ah your sketch doesn't work for me either, perhaps its not been tested on linux with a recent gcc-avr that's the usual issue when its moans about consts/scope etc?

Neither Linux nor the compiler are the issue. It is simply a deficiency (bug) in the core.

At this point, Tiny Tuner 2 will only work with the t861 processor.

Docedison:
No. I have ver .015 installed, I am unsure about how to proceed...

Don't bother. If you are content with -0015 stick with it. I just reviewed the changes: Not enough is different from -0015 to -0017 to warrant upgrading unless you have run into either of the two very minor problems that were fixed. (And you would know if you had run into either problem.)

I HATE to ask for hand holding type guidance but I LOVE the tiny cores and yours is the greatest...

I'm glad you like it! Hopefully, the new version will be significantly better!

Wops... I forgot this thread... I'll try your instructions as soon as possible. Thanks for your work :wink:

Tiny Tuner 2 now works with the usual suspects: t13, t84, t85, t2313, t861, m328 (and other members of those families). It is also core independent.

Excellent, will be testing this week.

It is also core independent.

Indeed it is, I just tried with an ATtiny 13 and Smeezekitty's core and got the expected result.

One thing that didn't work was the WriteToEEPROM example on the t13, nothing is written to EEPROM.
I tried tu use #include <EEPROM.h> instead of #include <avr/eeprom.h> but no luck.

On the other hand it works on an ATtiny85, so I've probably made ??some mistakes

Indeed it is, I just tried with an ATtiny 13 and Smeezekitty's core and got the expected result.

Excellent.

One thing that didn't work was the WriteToEEPROM example on the t13...

I assume the sketch is too big for the t13. Does this one change get it to fit...

const bool ReportStatus = false;

hiduino:
Excellent, will be testing this week.

Please let me know how it goes.

I don't think it is because the sketch is to big, this is the sketch sizes reported

ReportStatus = true;
Binary sketch size: 976

ReportStatus = false;
Binary sketch size:614 bytes

I will try again tomorrow with fresh corefiles, I maybe have messed them up

My findings so far:

Both examples work as expected on a t85 and your "old" core

PrintUsingKnockBang work on a t13 and smeezekitty's core

Problem solved.

I was using ATtiny13 @ 1,2 MHz, and the low fuse sat to 0x66

That meant the EEPROM was erased when uploading a new sketch, which is exactly what I did to check if the OSCCAL value had been written to EEPROM
I changed the fuse to 0x26, and everything is OK,
The OSCCAL value is written to address 62.

Thanks for this! Didn't want to start a new topic since it was such a niche post.

I got this working on an Attiny461, after learning that the pins had to be declared as constants. Haven't tried anything too advanced yet, just the blink sketch, but this is great you've done. Thank you.

Hi guys, today i received my new 861A´s but i´m having a hard time to get them working properly :frowning:

Since i got Knockbang to work with my attiny 85 i thought this wouldn´t be a problem :slight_smile:
I tried the TC core first and burnt its bootloader, because i didn´t know how to add the 8mhz variant in the boards.txt.
Uploading sketches works fine but i then switched to tinycore2 because of knockbang.
I still had compiler issues about Flashstringhelper being defined in Wstring.h and knockbang so i made a change to its header file.

//  #if TC_VERSION < 200
//    typedef fstr_t __FlashStringHelper;
//  #endif

Now knockbang works but your test sketch can´t compile :

ketch_mar01a.ino: In function 'void OutputOSCCALAssignment()':
sketch_mar01a:17: error: '_delay_ms' was not declared in this scope
sketch_mar01a.ino: In function 'void setup()':
sketch_mar01a:33: error: '_delay_ms' was not declared in this scope

My pinmappings are really weird aswell, i tried to enable pull up on PB6 and it seems to be 3/PB3.
Now i wanted to burn tinycore2 bootloader on it and i´m getting :

avrdude: verification error, first mismatch at byte 0x0000
         0xff != 0x01
avrdude: verification error; content mismatch

I ran Tinytuner2 example printusingknockbang and it gave me : // Initial value of OSCCAL is 0x94
The eeprom example seems to be doing nothing after : Tuning started...

I pretty much have no clue what´s going on, some help would be appreciated :slight_smile:

Hi @smithy,

smithy:
Hi guys, today i received my new 861A´s

I curious to know why you went with an 861 processor.

...but i´m having a hard time to get them working properly :frowning:

Bear in mind, Tiny Core 2 is a long way from complete. There is a high probability you will continue to bump into problems.

I tried the TC core first and burnt its bootloader, because i didn´t know how to add the 8mhz variant in the boards.txt.

I don't understand. There's an entry in Prospective Boards for the ATtiny861 @ 8 MHz...
http://code.google.com/p/arduino-tiny/source/browse/Prospective%20Boards.txt?repo=core2#438

Or are you referring to version 1 (Tiny Core without the "2")?

I still had compiler issues about Flashstringhelper being defined in Wstring.h and knockbang so i made a change to its header file.

I will try to block off some time this week to look at that.

My pinmappings are really weird aswell, i tried to enable pull up on PB6 and it seems to be 3/PB3.

They are weird and I'm open to suggestions. The 328 processor is mapped from the upper-left to the upper-right in a U shape. The 84 processor is mapped the same way. The 85 processor is mapped by bit-within-the-port.

Would you prefer a mapping like the 328 and 84?

Also bear in mind I've stopped work on Arduino 1.0. If you plan to follow along you will have to move to Arduino 1.5. (I have had no problems running the two side-by-side.)

Thanks for your fast response !

Well when you look at this page AVR Overview and are looking for the most precise current measure + most pins it´s obvious to chose the x61 family.
I want to drive an lcd in 4 bit mode + 2-3 buttons, which is quite hard if you use a pdip8.
It is possible but you have to buy 2 PCF8574 or a 16 bit port expander for which the pin definition for driving the lcd with i2c lib is not clear to me. It also increases the cost for this project alot !
Since the 85 only has 1x and 20x gain, I first went for the 32u4, but it only has bipolar mode resulting in 9 bits and theres no pdip :frowning:
The 861 is the only chip having unipolar mode and even better gain stages of 1, 8, 20 and 32x plus plenty of pins to mess with !

Or are you referring to version 1 (Tiny Core without the "2")?

I´m sorry i kinda messed something up in my head when writing this, after checking my documents folder it seems i have the TC core still installed, but it seems i got knockbang to work with it.
I´m still a bit confused about which versions to use since i worked with tinycore1 before and had all the "old" versions, i saw that you named the zips on the google code page to version 2.
So far i have replaced only the knockbang, i guess its wise to replace tinyisp aswell ?

Just curious, what does

#if TC_VERSION < 200
typedef fstr_t __FlashStringHelper;
 #endif

do ?

Gonna switch to tinycore2 and do some testing to report after.

As far as the pin mapping is concerned, i guess the reason i have even more weird pin mappings is due to the other core ?
My pin mapping would look like this.

                    +-\/-+
       (D 0)  PB0  1|    |20 PA0  (D 15)
      *(D 1)  PB1  2|    |19 PA1  (D 14)
       (D 2)  PB2  3|    |18 PA2  (D 13)  INT1
      *(D 3)  PB3  4|    |17 PA3  (D 12)
              VCC  5|    |16 AGND
              GND  6|    |15 AVCC
       (D 4)  PB4  7|    |14 PA4  (D 11)
      *(D 5)  PB5  8|    |13 PA5  (D 10)
 INT0  (D 6)  PB6  9|    |12 PA6  (D 9)
       (D 7)  PB7 10|    |11 PA7  (D 8 )
                    +----+

A0 should be ADC0 and so on, haven´t made an own pinout yet so i don´t know how that works.

Switched to Tinycore2 and having different compiler problems now :frowning:

Delay doesnt workt but can be replaced with _delay_ms it seems.
I removed the outcommented lines from knockbang.h and it compiles and works.
When i try to compile the lcd blink example i get :

In file included from Blink.ino:40:
C:\My Progs\arduino-1.0.3\libraries\LiquidCrystal/LiquidCrystal.h:45: error: expected class-name before '{' token
C:\My Progs\arduino-1.0.3\libraries\LiquidCrystal/LiquidCrystal.h:82: error: 'size_t' does not name a type
C:\My Progs\arduino-1.0.3\libraries\LiquidCrystal/LiquidCrystal.h:85: error: 'Print' has not been declared
In file included from Blink.ino:43:
C:\Users\Master\Documents\Arduino\hardware\Tinycore2\cores\tiny/Arduino.h: In function 'int32_t randomI(int32_t)':
C:\Users\Master\Documents\Arduino\hardware\Tinycore2\cores\tiny/Arduino.h:1261: error: 'UINT8_MAX' was not declared in this scope
C:\Users\Master\Documents\Arduino\hardware\Tinycore2\cores\tiny/Arduino.h:1265: error: 'UINT16_MAX' was not declared in this scope
C:\Users\Master\Documents\Arduino\hardware\Tinycore2\cores\tiny/Arduino.h:1276: error: 'UINT8_MAX' was not declared in this scope
C:\Users\Master\Documents\Arduino\hardware\Tinycore2\cores\tiny/Arduino.h:1280: error: 'UINT16_MAX' was not declared in this scope
Blink.ino: In function 'void setup()':
Blink:49: error: 'class LiquidCrystal' has no member named 'print'

Now i know why i switched to the TCWORLD core again, because i could compile using libraries using print.
But isn´t knockbang using print aswell and can compile ?

I´d really like to stay with your work but for now I have no other solution than switching to TCWORLD core again and find out its pin mapping.

For those interested, heres the pinout for the TCWORLD Core, got the lcd to work in 4bit mode, but only with the standard lcd library.
Even though this is a bit offtopic :
The extended lcd lib keeps complaining about Wire.h when compiling (even though i didnt include LiquidCrystal_I2C.h) so i deleted LCDI2CIO.h/cpp and LiquidCrystal_I2C.h/cpp leaving me with following error :
LiquidCrystal\LCD.cpp.o:(.rodata._ZTV3LCD+0xe): undefined reference to `__cxa_pure_virtual'
Any clue ?

Big thanks for your time !

Pinout TCWORLD Core.ods (10.6 KB)