Go Down

Topic: Tiny Core 2 + ATtiny861 (Read 25876 times) previous topic - next topic

Coding Badly

#30
Jul 01, 2013, 08:54 am Last Edit: Jul 01, 2013, 09:02 am by Coding Badly Reason: 1
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[font=Courier New] {SketchbookFolder}/hardware/tiny2/variants/ [/font]directory

• Create a new folder named[font=Courier New] leo72[/font]

• Navigate to the[font=Courier New] standard [/font]([font=Courier New] {SketchbookFolder}/hardware/tiny2/variants/standard/ [/font]) directory

• Select and copy the[font=Courier New] tc_build_options.h [/font]file

• Navigate to the[font=Courier New] leo72 [/font]([font=Courier New] {SketchbookFolder}/hardware/tiny2/variants/leo72/ [/font]) directory

• Paste the[font=Courier New] tc_build_options.h [/font]file into the[font=Courier New] leo72 [/font]directory

• Open the[font=Courier New] tc_build_options.h [/font]file in your favourite text editor

• Locate the following section, remove the comment from the[font=Courier New] #define[/font], save the file, close the text editor

Code: [Select]
/*=============================================================================
 Which timer should be used for millis
=============================================================================*/

#define TC_TIMER_TO_USE_FOR_MILLIS  1


• Navigate to the[font=Courier New] {SketchbookFolder}/hardware/tiny2/ [/font]directory

• Open the[font=Courier New] boards.txt [/font]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[font=Courier New] attiny861at8 [/font]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[font=Courier New] attiny861at8 [/font]to[font=Courier New] leo72[/font].

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

• Change the[font=Courier New] BOARD.build.variant [/font]value to[font=Courier New] leo72[/font].  For example, I changed[font=Courier New] leo72.build.variant=standard [/font]to[font=Courier New] leo72.build.variant=leo72[/font].

• This is my complete example...

Code: [Select]
################################################################################

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!

Coding Badly

#31
Jul 01, 2013, 09:14 am Last Edit: Jul 01, 2013, 09:16 am by Coding Badly Reason: 1
The tuned frequence was 1.194 MHz !


Excellent!

Quote
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!

Quote
Once again Thankyou for maintaining and improving the Tiny core


You are welcome.

Quote
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[font=Courier New] tc_eeprom_config.h[/font].

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...

Code: [Select]
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...

Code: [Select]
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).

Coding Badly

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.

Quote
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.

Quote
P.S. will this core allow the third PWM pin like 0017 does? bloody marvellous feature that is BTW  :smiley-mr-green:


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

Quote
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.

Coding Badly

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.)

Quote
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!

leo72


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


There is now.  Instructions...

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

Coding Badly

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


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.

hiduino

Excellent, will be testing this week.

Erni

Quote
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

Coding Badly

#38
Jul 15, 2013, 09:51 pm Last Edit: Jul 15, 2013, 11:59 pm by Coding Badly Reason: 1
Quote
Indeed it is, I just tried with an ATtiny 13 and Smeezekitty's core and got the expected result.


Excellent.

Quote
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...

[font=Courier New]const bool ReportStatus = false;[/font]

Coding Badly

Excellent, will be testing this week.


Please let me know how it goes.

Erni


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

Erni

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.

secretsather

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.

smithy

#43
Mar 01, 2014, 09:12 pm Last Edit: Mar 01, 2014, 09:23 pm by smithy Reason: 1
Hi guys, today i received my new 861A´s but i´m having a hard time to get them working properly :(

Since i got Knockbang to work with my attiny 85 i thought this wouldn´t be a problem :)
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.
Code: [Select]

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

Now knockbang works but your test sketch can´t compile :
Code: [Select]

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 :
Code: [Select]

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 :)

Coding Badly

Hi @smithy,

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


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

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


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

Quote
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")?

Quote
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.

Quote
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.)

Go Up