Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the process to add the ATTiny88? #22

Closed
tomscatliff opened this issue Jul 16, 2014 · 40 comments
Closed

What's the process to add the ATTiny88? #22

tomscatliff opened this issue Jul 16, 2014 · 40 comments

Comments

@tomscatliff
Copy link
Contributor

I'm happy to take a shot at the pins_arduino.h file for the ATTiny88 and test on it.

Can you describe the test procedure? How do I build an empty/tiny core for the device? gcc-avr? Also, is the empty core sufficient for deploying code (ie. a blink sketch or similar) to the 88?

@TCWORLD
Copy link
Owner

TCWORLD commented Jul 16, 2014

Starting with this core: https://github.com/TCWORLD/ATTinyCore/tree/master/tiny
First Step is to make a pins_arduino,h file. You can use the others as a template.
Next make a boards.txt entry.
Then try compiling a test sketch with Arduino and see if it works.

@tomscatliff
Copy link
Contributor Author

I can do that. Just so I'm not making any assumptions, to program the ATTiny88 I should probably use the ArduinoISP approach?

And, to confirm, a compiled (.hex) core is not necessary if I use the ArduinoISP approach, correct?

@TCWORLD
Copy link
Owner

TCWORLD commented Jul 16, 2014

You can use ArduinoISP, you can use an AVR-ISP, you can use any programmer you have, it doesn't make any difference. If you use the Arduino IDE, and 'Upload Using Programmer', then you don't need to worry where the hex file is, the IDE knows where it is.

@TCWORLD
Copy link
Owner

TCWORLD commented Jul 16, 2014

The main difficulty is if it doesn't compile, because then you have to find out why - usually it will be due to differences in the register bit names or arrangements of bits in a register.

@pranavt
Copy link

pranavt commented Jul 23, 2014

Any update on this? Interested in using ATTiny48/88 too. If nothing happens, I'll get my hands dirty and try to create a pins_arduino.h file myself.

@tomscatliff
Copy link
Contributor Author

No real progress. Created a basic pins_arduino.h, and started running into some compile issues with timers. Haven't had much chance to investigate, got pulled into another project for now, and doesn't look like I can get back at until for a couple of weeks.

@tomscatliff
Copy link
Contributor Author

I've got the ATtiny88 compiling with the TinyNoMillis core, and the
standard Arduino core.

I've attached the pins_arduino.h, and the updated boards.txt. GitHub tells
me I have no permission to commit my changes.

On Wed, Jul 16, 2014 at 9:07 AM, Tom Carpenter notifications@github.com
wrote:

The main difficulty is if it doesn't compile, because then you have to
find out why - usually it will be due to differences in the register bit
names or arrangements of bits in a register.


Reply to this email directly or view it on GitHub
#22 (comment).

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

Example boards.txt from...

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236434254/94#94

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274754985/6#6

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274820597/49#49

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

attiny84at16.name=ATtiny84 @ 16 MHz (external crystal; 4.3 V BOD)

The following do NOT work...

attiny84at16.upload.using=avrispv2

attiny84at16.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny84at16.upload.using=arduino:arduinoisp

attiny84at16.upload.protocol=avrispv2

attiny84at16.upload.using=pololu

attiny84at16.upload.maximum_size=8192

Frequency 8.0- MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms; [CKSEL=1111 SUT=11]

Brown-out detection level at VCC=4.3 V; [BODLEVEL=100]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

Serial program downloading (SPI) enabled; [SPIEN=0]

attiny84at16.bootloader.low_fuses=0xFF
attiny84at16.bootloader.high_fuses=0xD4
attiny84at16.bootloader.extended_fuses=0xFF
attiny84at16.bootloader.path=empty
attiny84at16.bootloader.file=empty84at16.hex

attiny84at16.build.mcu=attiny84
attiny84at16.build.f_cpu=16000000L
attiny84at16.build.core=tiny
attiny84at16.build.variant=tinyX4

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

attiny84at8.name=ATtiny84 @ 8 MHz (internal oscillator; BOD disabled)

The following do NOT work...

attiny84at8.upload.using=avrispv2

attiny84at8.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny84at8.upload.using=arduino:arduinoisp

attiny84at8.upload.protocol=avrispv2

attiny84at8.upload.using=pololu

attiny84at8.upload.maximum_size=8192

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

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]

attiny84at8.bootloader.low_fuses=0xE2
attiny84at8.bootloader.high_fuses=0xD7
attiny84at8.bootloader.extended_fuses=0xFF
attiny84at8.bootloader.path=empty
attiny84at8.bootloader.file=empty84at8.hex

attiny84at8.build.mcu=attiny84
attiny84at8.build.f_cpu=8000000L
attiny84at8.build.core=tiny
attiny84at8.build.variant=tinyX4

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

attiny84at1.name=ATtiny84 @ 1 MHz (internal oscillator; BOD disabled)

The following do NOT work...

attiny84at1.upload.using=avrispv2

attiny84at1.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny84at1.upload.using=arduino:arduinoisp

attiny84at1.upload.protocol=avrispv2

attiny84at1.upload.using=pololu

attiny84at1.upload.maximum_size=8192

Default clock (slowly rising power; long delay to clock; 8 MHz internal; divide clock by 8)

Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value

Divide clock by 8 internally; [CKDIV8=0]

Brown-out detection disabled; [BODLEVEL=111]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny84at1.bootloader.low_fuses=0x62
attiny84at1.bootloader.high_fuses=0xD7
attiny84at1.bootloader.extended_fuses=0xFF
attiny84at1.bootloader.path=empty
attiny84at1.bootloader.file=empty84at1.hex

attiny84at1.build.mcu=attiny84
attiny84at1.build.f_cpu=1000000L
attiny84at1.build.core=tiny
attiny84at1.build.variant=tinyX4

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

attiny44at8.name=ATtiny44 @ 8 MHz (internal oscillator; BOD disabled)

The following do NOT work...

attiny44at8.upload.using=avrispv2

attiny44at8.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny44at8.upload.using=arduino:arduinoisp

attiny44at8.upload.protocol=avrispv2

attiny44at8.upload.using=pololu

attiny44at8.upload.maximum_size=4096

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

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]

attiny44at8.bootloader.low_fuses=0xE2
attiny44at8.bootloader.high_fuses=0xD7
attiny44at8.bootloader.extended_fuses=0xFF
attiny44at8.bootloader.path=empty
attiny44at8.bootloader.file=empty44at8.hex

attiny44at8.build.mcu=attiny44
attiny44at8.build.f_cpu=8000000L
attiny44at8.build.core=tiny
attiny44at8.build.variant=tinyX4

attiny44at8.build.core=empty

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

attiny44at1.name=ATtiny44 @ 1 MHz (internal oscillator; BOD disabled)

The following do NOT work...

attiny44at1.upload.using=avrispv2

attiny44at1.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny44at1.upload.using=arduino:arduinoisp

attiny44at1.upload.protocol=avrispv2

attiny44at1.upload.using=pololu

attiny44at1.upload.maximum_size=4096

Default clock (slowly rising power; long delay to clock; 8 MHz internal; divide clock by 8)

Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value

Divide clock by 8 internally; [CKDIV8=0]

Brown-out detection disabled; [BODLEVEL=111]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny44at1.bootloader.low_fuses=0x62
attiny44at1.bootloader.high_fuses=0xD7
attiny44at1.bootloader.extended_fuses=0xFF
attiny44at1.bootloader.path=empty
attiny44at1.bootloader.file=empty44at1.hex

attiny44at1.build.mcu=attiny44
attiny44at1.build.f_cpu=1000000L
attiny44at1.build.core=tiny
attiny44at1.build.variant=tinyX4

attiny44at1.build.core=empty

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

attiny24at16.name=ATtiny24 @ 16 MHz (external crystal; BOD disabled)

The following do NOT work...

attiny24at16.upload.using=avrispv2

attiny24at16.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny24at16.upload.using=arduino:arduinoisp

attiny24at16.upload.protocol=avrispv2

attiny24at16.upload.using=pololu

attiny24at16.upload.maximum_size=2048

Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms; [CKSEL=1111 SUT=11]

Brown-out detection disabled; [BODLEVEL=111]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

Serial program downloading (SPI) enabled; [SPIEN=0]

attiny24at16.bootloader.low_fuses=0xFF
attiny24at16.bootloader.high_fuses=0xD7
attiny24at16.bootloader.extended_fuses=0xFF
attiny24at16.bootloader.path=empty
attiny24at16.bootloader.file=empty24at16.hex

attiny24at16.build.mcu=attiny24
attiny24at16.build.f_cpu=16000000L
attiny24at16.build.core=tiny
attiny24at16.build.variant=tinyX4

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

attiny85at16e.name=ATtiny85 @ 16 MHz (external crystal; 4.3 V BOD)

The following do NOT work...

attiny85at16e.upload.using=avrispv2

attiny85at16e.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny85at16e.upload.using=arduino:arduinoisp

attiny85at16e.upload.protocol=avrispv2

attiny85at16e.upload.using=pololu

attiny85at16e.upload.maximum_size=8192

Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms; [CKSEL=1111 SUT=11]

Brown-out detection level at VCC=4.3 V; [BODLEVEL=100]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

Serial program downloading (SPI) enabled; [SPIEN=0]

attiny85at16e.bootloader.low_fuses=0xFF
attiny85at16e.bootloader.high_fuses=0xD4
attiny85at16e.bootloader.extended_fuses=0xFF
attiny85at16e.bootloader.path=empty
attiny85at16e.bootloader.file=empty85at16.hex

attiny85at16e.build.mcu=attiny85
attiny85at16e.build.f_cpu=16000000L
attiny85at16e.build.core=tiny
attiny85at16e.build.variant=tinyX5

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

attiny85at16p.name=ATtiny85 @ 16 MHz (internal PLL; 4.3 V BOD)

The following do NOT work...

attiny85at16p.upload.using=avrispv2

attiny85at16p.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny85at16p.upload.using=arduino:arduinoisp

attiny85at16p.upload.protocol=avrispv2

attiny85at16p.upload.using=pololu

attiny85at16p.upload.maximum_size=8192

PLL Clock; Start-up time PWRDWN/RESET: 1K CK/14 CK + 4 ms; [CKSEL=0001 SUT=00]

Brown-out detection level at VCC=4.3 V; [BODLEVEL=100]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

Serial program downloading (SPI) enabled; [SPIEN=0]

attiny85at16p.bootloader.low_fuses=0xC1
attiny85at16p.bootloader.high_fuses=0xD4
attiny85at16p.bootloader.extended_fuses=0xFF
attiny85at16p.bootloader.path=empty
attiny85at16p.bootloader.file=empty85at16.hex

attiny85at16p.build.mcu=attiny85
attiny85at16p.build.f_cpu=16000000L
attiny85at16p.build.core=tiny
attiny85at16p.build.variant=tinyX5

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

attiny861at1.name=ATtiny861 @ 1 MHz (internal oscillator; BOD disabled)

attiny861at1.upload.using=arduino:arduinoisp

attiny861at1.upload.maximum_size=8192

Default clock (slowly rising power; long delay to clock; 1 MHz internal)

Int. RC Osc. 8 MHz divided by 8; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value

Brown-out detection disabled; [BODLEVEL=111]

attiny861at1.bootloader.low_fuses=0x62
attiny861at1.bootloader.high_fuses=0xDF
attiny861at1.bootloader.extended_fuses=0xFF
attiny861at1.bootloader.path=empty
attiny861at1.bootloader.file=empty861at8.hex

attiny861at1.build.mcu=attiny861
attiny861at1.build.f_cpu=1000000L
attiny861at1.build.core=tiny
attiny861at1.build.variant=tinyX61

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

attiny861at18.name=ATtiny861 @ 18.432 MHz (external oscillator; BOD disabled)

attiny861at18.upload.using=arduino:arduinoisp

attiny861at18.upload.maximum_size=8192

Default clock (slowly rising power; long delay to clock; 1 MHz internal)

Int. RC Osc. 8 MHz divided by 8; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value

Brown-out detection disabled; [BODLEVEL=111]

attiny861at18.bootloader.low_fuses=0xA0
attiny861at18.bootloader.high_fuses=0xD7
attiny861at18.bootloader.extended_fuses=0x00
attiny861at18.bootloader.path=empty
attiny861at18.bootloader.file=empty861at8.hex

attiny861at18.build.mcu=attiny861
attiny861at18.build.f_cpu=18432000L
attiny861at18.build.core=tiny
attiny861at18.build.variant=tinyX61

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

attiny85at8.name=ATtiny85 @ 8 MHz (internal oscillator; BOD disabled)

The following do NOT work...

attiny85at8.upload.using=avrispv2

attiny85at8.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny85at8.upload.using=arduino:arduinoisp

attiny85at8.upload.protocol=avrispv2

attiny85at8.upload.using=pololu

attiny85at8.upload.maximum_size=8192

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

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]

attiny85at8.bootloader.low_fuses=0xE2
attiny85at8.bootloader.high_fuses=0xD7
attiny85at8.bootloader.extended_fuses=0xFF
attiny85at8.bootloader.path=empty
attiny85at8.bootloader.file=empty85at8.hex

attiny85at8.build.mcu=attiny85
attiny85at8.build.f_cpu=8000000L
attiny85at8.build.core=tiny
attiny85at8.build.variant=tinyX5

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

attiny85at1.name=ATtiny85 @ 1 MHz (internal oscillator; BOD disabled)

The following do NOT work...

attiny85at1.upload.using=avrispv2

attiny85at1.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny85at1.upload.using=arduino:arduinoisp

attiny85at1.upload.protocol=avrispv2

attiny85at1.upload.using=pololu

attiny85at1.upload.maximum_size=8192

Default clock (slowly rising power; long delay to clock; 8 MHz internal; divide clock by 8)

Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value

Divide clock by 8 internally; [CKDIV8=0]

Brown-out detection disabled; [BODLEVEL=111]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny85at1.bootloader.low_fuses=0x62
attiny85at1.bootloader.high_fuses=0xD7
attiny85at1.bootloader.extended_fuses=0xFF
attiny85at1.bootloader.path=empty
attiny85at1.bootloader.file=empty85at1.hex

attiny85at1.build.mcu=attiny85
attiny85at1.build.f_cpu=1000000L
attiny85at1.build.core=tiny
attiny85at1.build.variant=tinyX5

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

attiny45at8.name=ATtiny45 @ 8 MHz

The following do NOT work...

attiny45at8.upload.using=avrispv2

attiny45at8.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny45at8.upload.using=arduino:arduinoisp

attiny45at8.upload.protocol=avrispv2

attiny45at8.upload.using=pololu

attiny45at8.upload.maximum_size=4096

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

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]

attiny45at8.bootloader.low_fuses=0xE2
attiny45at8.bootloader.high_fuses=0xD7
attiny45at8.bootloader.extended_fuses=0xFF
attiny45at8.bootloader.path=empty
attiny45at8.bootloader.file=empty45at8.hex

attiny45at8.build.mcu=attiny45
attiny45at8.build.f_cpu=8000000L
attiny45at8.build.core=tiny
attiny45at8.build.variant=tinyX5

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

attiny45at1.name=ATtiny45 @ 1 MHz

The following do NOT work...

attiny45at1.upload.using=avrispv2

attiny45at1.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny45at1.upload.using=arduino:arduinoisp

attiny45at1.upload.protocol=avrispv2

attiny45at1.upload.using=pololu

attiny45at1.upload.maximum_size=4096

Default clock (slowly rising power; long delay to clock; 8 MHz internal; divide clock by 8)

Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value

Divide clock by 8 internally; [CKDIV8=0]

Brown-out detection disabled; [BODLEVEL=111]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny45at1.bootloader.low_fuses=0x62
attiny45at1.bootloader.high_fuses=0xD7
attiny45at1.bootloader.extended_fuses=0xFF
attiny45at1.bootloader.path=empty
attiny45at1.bootloader.file=empty45at1.hex

attiny45at1.build.mcu=attiny45
attiny45at1.build.f_cpu=1000000L
attiny45at1.build.core=tiny
attiny45at1.build.variant=tinyX5

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

attiny85at128.name=ATtiny85 @ 128 KHz (watchdog oscillator; 1.8 V BOD)

The following do NOT work...

attiny85at128.upload.using=avrispv2

attiny85at128.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny85at128.upload.using=arduino:arduinoisp

attiny85at128.upload.protocol=avrispv2

attiny85at128.upload.using=pololu

attiny85at128.upload.maximum_size=8192

WD. Osc. 128 kHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 0 ms; [CKSEL=0100 SUT=00]

Brown-out detection level at VCC=1.8 V; [BODLEVEL=110]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

Serial program downloading (SPI) enabled; [SPIEN=0]

attiny85at128.bootloader.low_fuses=0xC4
attiny85at128.bootloader.high_fuses=0xD6
attiny85at128.bootloader.extended_fuses=0xFF
attiny85at128.bootloader.path=empty
attiny85at128.bootloader.file=empty85at1.hex

attiny85at128.build.mcu=attiny85
attiny85at128.build.f_cpu=128000L
attiny85at128.build.core=tiny
attiny85at128.build.variant=tinyX5

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

attiny25at8.name=ATtiny25 @ 8 MHz

The following do NOT work...

attiny25at8.upload.using=avrispv2

attiny25at8.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny25at8.upload.using=arduino:arduinoisp

attiny25at8.upload.protocol=avrispv2

attiny25at8.upload.using=pololu

attiny25at8.upload.maximum_size=2048

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

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]

attiny25at8.bootloader.low_fuses=0xE2
attiny25at8.bootloader.high_fuses=0xD7
attiny25at8.bootloader.extended_fuses=0xFF
attiny25at8.bootloader.path=empty
attiny25at8.bootloader.file=empty25at8.hex

attiny25at8.build.mcu=attiny25
attiny25at8.build.f_cpu=8000000L
attiny25at8.build.core=tiny
attiny25at8.build.variant=tinyX5

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

attiny25at1.name=ATtiny25 @ 1 MHz

The following do NOT work...

attiny25at1.upload.using=avrispv2

attiny25at1.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny25at1.upload.using=arduino:arduinoisp

attiny25at1.upload.protocol=avrispv2

attiny25at1.upload.using=pololu

attiny25at1.upload.maximum_size=2048

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

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]

attiny25at1.bootloader.low_fuses=0x62
attiny25at1.bootloader.high_fuses=0xD7
attiny25at1.bootloader.extended_fuses=0xFF
attiny25at1.bootloader.path=empty
attiny25at1.bootloader.file=empty25at1.hex

attiny25at1.build.mcu=attiny25
attiny25at1.build.f_cpu=1000000L
attiny25at1.build.core=tiny
attiny25at1.build.variant=tinyX5

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

attiny2313at8.name=ATtiny2313 @ 8 MHz

The following do NOT work...

attiny2313at8.upload.using=avrispv2

attiny2313at8.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny2313at8.upload.using=arduino:arduinoisp

attiny2313at8.upload.protocol=avrispv2

attiny2313at8.upload.using=pololu

attiny2313at8.upload.maximum_size=2048

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

Int. RC Osc. 8 MHz; Start-up time: 14 CK + 65 ms; [CKSEL=0100 SUT=10]; default value

Brown-out detection disabled; [BODLEVEL=111]

Serial program downloading (SPI) enabled; [SPIEN=0]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny2313at8.bootloader.low_fuses=0xE4
attiny2313at8.bootloader.high_fuses=0x9F
attiny2313at8.bootloader.extended_fuses=0xFF
attiny2313at8.bootloader.path=empty
attiny2313at8.bootloader.file=empty2313at8.hex

attiny2313at8.build.mcu=attiny2313
attiny2313at8.build.f_cpu=8000000L
attiny2313at8.build.core=tiny
attiny2313at8.build.variant=tinyX313

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

attiny2313at1.name=ATtiny2313 @ 1 MHz

The following do NOT work...

attiny2313at1.upload.using=avrispv2

attiny2313at1.upload.using=Pololu USB AVR Programmer

The following DO work (pick one)...

attiny2313at1.upload.using=arduino:arduinoisp

attiny2313at1.upload.protocol=avrispv2

attiny2313at1.upload.using=pololu

attiny2313at1.upload.maximum_size=2048

Default clock (slowly rising power; long delay to clock; 8 MHz internal; divide clock by 8)

Int. RC Osc. 8 MHz; Start-up time: 14 CK + 65 ms; [CKSEL=0100 SUT=10]; default value

Divide clock by 8 internally; [CKDIV8=0]

Brown-out detection disabled; [BODLEVEL=111]

Serial program downloading (SPI) enabled; [SPIEN=0]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny2313at1.bootloader.low_fuses=0x64
attiny2313at1.bootloader.high_fuses=0x9F
attiny2313at1.bootloader.extended_fuses=0xFF
attiny2313at1.bootloader.path=empty
attiny2313at1.bootloader.file=empty2313at1.hex

attiny2313at1.build.mcu=attiny2313
attiny2313at1.build.f_cpu=1000000L
attiny2313at1.build.core=tiny
attiny2313at1.build.variant=tinyX313

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

attiny167.name=ATtiny167 @ 8 MHz (internal oscillator; BOD enabled)

attiny167.upload.using=arduino:arduinoisp

attiny167.upload.maximum_size=16384

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

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]

Self-Programming Disabled; [SELFPRGEN=1]

attiny167.bootloader.low_fuses=0xE2
attiny167.bootloader.high_fuses=0xD7
attiny167.bootloader.extended_fuses=0xFF
attiny167.bootloader.path=empty
attiny167.bootloader.file=empty167.hex

attiny167.build.mcu=attiny167
attiny167.build.f_cpu=8000000L
attiny167.build.core=tiny
attiny167.build.variant=tinyX7

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

attiny87.name=ATtiny87 @ 8 MHz (internal oscillator; BOD enabled)

attiny87.upload.using=arduino:arduinoisp

attiny87.upload.maximum_size=8192

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

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]

Self-Programming Disabled; [SELFPRGEN=1]

attiny87.bootloader.low_fuses=0xE2
attiny87.bootloader.high_fuses=0xD7
attiny87.bootloader.extended_fuses=0xFF
attiny87.bootloader.path=empty
attiny87.bootloader.file=empty87.hex

attiny87.build.mcu=attiny87
attiny87.build.f_cpu=8000000L
attiny87.build.core=tiny
attiny87.build.variant=tinyX7

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

attiny167_20.name=Optiboot ATtiny167 @ 20 MHz (external oscillator; BOD enabled)

attiny167_20.upload.protocol=arduino
attiny167_20.upload.speed=57600
attiny167_20.upload.maximum_size=15808

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

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]

Self-Programming Enabled; [SELFPRGEN=0]

attiny167_20.bootloader.low_fuses=0xA0
attiny167_20.bootloader.high_fuses=0xDF
attiny167_20.bootloader.extended_fuses=0xFE
attiny167_20.bootloader.path=optiboot
attiny167_20.bootloader.file=optiboot_attiny167.hex

attiny167_20.build.mcu=attiny167
attiny167_20.build.f_cpu=20000000L
attiny167_20.build.core=tiny
attiny167_20.build.variant=tinyX7

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

attiny84_12.name=Optiboot ATtiny84 @ 12 MHz (external osc)

attiny84_12.upload.protocol=arduino
attiny84_12.upload.speed=19200
#bootloader takes up last 9 pages, so there is a limit on the max size.
attiny84_12.upload.maximum_size=7616

attiny84_12.bootloader.low_fuses=0xE0
attiny84_12.bootloader.high_fuses=0xD7
attiny84_12.bootloader.extended_fuses=0xFE
attiny84_12.bootloader.path=optiboot
attiny84_12.bootloader.file=optiboot_attiny84_12.hex

attiny84_12.build.mcu=attiny84
attiny84_12.build.f_cpu=12000000L
attiny84_12.build.core=tiny
attiny84_12.build.variant=tinyX4optiboot

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

attiny84_12_no.name=Optiboot ATtiny84 @ 12 MHz (external osc - NO MILLIS!)

attiny84_12_no.upload.protocol=arduino
attiny84_12_no.upload.speed=19200
#bootloader takes up last 9 pages, so there is a limit on the max size.
attiny84_12_no.upload.maximum_size=7616

attiny84_12_no.bootloader.low_fuses=0xE0
attiny84_12_no.bootloader.high_fuses=0xD7
attiny84_12_no.bootloader.extended_fuses=0xFE
attiny84_12_no.bootloader.path=optiboot
attiny84_12_no.bootloader.file=optiboot_attiny84_12.hex

attiny84_12_no.build.mcu=attiny84
attiny84_12_no.build.f_cpu=12000000L
attiny84_12_no.build.core=tinyNoMillis
attiny84_12_no.build.variant=tinyX4optiboot
###########################################################################
attiny84.name=Optiboot ATtiny84 @ 8 MHz (internal osc)

attiny84.upload.protocol=arduino
attiny84.upload.speed=19200
#bootloader takes up last 9 pages, so there is a limit on the max size.
attiny84.upload.maximum_size=7616

attiny84.bootloader.low_fuses=0xE2
attiny84.bootloader.high_fuses=0xD7
attiny84.bootloader.extended_fuses=0xFE
attiny84.bootloader.path=optiboot
attiny84.bootloader.file=optiboot_attiny84.hex

attiny84.build.mcu=attiny84
attiny84.build.f_cpu=8000000L
attiny84.build.core=tiny
attiny84.build.variant=tinyX4optiboot

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

attiny84nr.name=Optiboot ATtiny84 @ 8 MHz (NO RESET!)

attiny84nr.upload.protocol=arduino
attiny84nr.upload.speed=19200
#bootloader takes up last 9 pages, so there is a limit on the max size.
attiny84nr.upload.maximum_size=7616

attiny84nr.bootloader.low_fuses=0xE2
attiny84nr.bootloader.high_fuses=0x57
attiny84nr.bootloader.extended_fuses=0xFE
attiny84nr.bootloader.path=optiboot
attiny84nr.bootloader.file=optiboot_attiny84.hex

attiny84nr.build.mcu=attiny84
attiny84nr.build.f_cpu=8000000L
attiny84nr.build.core=tiny
attiny84nr.build.variant=tinyX4optiboot

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

attiny85.name=Optiboot ATtiny85 @ 8 MHz (internal osc)

attiny85.upload.protocol=arduino
attiny85.upload.speed=19200
#bootloader takes up last 9 pages, so there is a limit on the max size.
attiny85.upload.maximum_size=7616

attiny85.bootloader.low_fuses=0xE2
attiny85.bootloader.high_fuses=0xD7
attiny85.bootloader.extended_fuses=0xFE
attiny85.bootloader.path=optiboot
attiny85.bootloader.file=optiboot_attiny85.hex

attiny85.build.mcu=attiny85
attiny85.build.f_cpu=8000000L
attiny85.build.core=tiny
attiny85.build.variant=tinyX5optiboot

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

attiny88.name=ATtiny88 @ 1 MHz (internal oscillator; BOD enabled)
attiny88.upload.using=arduino:arduinoisp
attiny88.upload.maximum_size=8192

Default clock (slowly rising power; long delay to clock; 8 MHz internal)

Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 65 ms; [CKSEL=1110 SUT=10]; default value

Divide clock by 8 internally; [CKDIV8=0]

attiny88.bootloader.low_fuses=0x6E

Brown-out detection disabled; [BODLEVEL=111]

Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

Serial program downloading (SPI) enabled; [SPIEN=0]

attiny88.bootloader.high_fuses=0xD7

Self-Programming Disabled; [SELFPRGEN=1]

attiny88.bootloader.extended_fuses=0x06

attiny88.bootloader.path=
attiny88.bootloader.file=
attiny88.build.mcu=attiny88
attiny88.build.f_cpu=1000000L
attiny88.build.core=arduino
/* standard arduino core also compiles: */
//attiny88.build.core=arduino
attiny88.build.variant=tinyX8

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

@TCWORLD
Copy link
Owner

TCWORLD commented Aug 12, 2014

If you fork the repository, you can commit changes to your own fork, and then they can be merged back into this one.

@tomscatliff
Copy link
Contributor Author

Thanks, new to the whole github thing.

I've forked to tomscatliff/ATTinyCore, and committed the changes.

On Tue, Aug 12, 2014 at 9:14 AM, Tom Carpenter notifications@github.com
wrote:

If you fork the repository, you can commit changes to your own fork, and
then they can be merged back into this one.


Reply to this email directly or view it on GitHub
#22 (comment).

@den4444
Copy link

den4444 commented Aug 29, 2014

moved to issue #25

@fritsjan
Copy link

fritsjan commented Sep 9, 2014

Hi tomscatliff/TCWORLD,

What still needs to be done to be able to use this core for the attiny88?
And how (with what limitations) can it be used already?

@jseaber
Copy link

jseaber commented Nov 26, 2014

@tomscatliff: Have you had a chance to test real hardware?

I see the commented pin mapping is for the 28 pin PDIP and QFN packages, which has 12 (or 18?) digital pins and 6 analog inputs. But lines 35-36 define 16 pins and 11 pins, respectively (https://github.com/TCWORLD/ATTinyCore/blob/master/tiny/variants/tinyX8/pins_arduino.h). This is the first time I've looked at a pins_arduino.h file, so I may be missing something.

The TQFP-32 pin package and QFN-32 pin packages of ATtiny48/88 contain four additional pins under Port A:

-PA0
-PA1
-PA2
-PA3

@TCWORLD: Can you please advise how to implement Port A? I assume this will do it, but am unsure whether the order of the array contents is critical, and whether the core support PA.

I have a PCB with a 32-pin ATTiny44/88 on the way and can provide hardware feedback soon.

const uint16_t PROGMEM port_to_mode_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
(uint16_t) &DDRB,
(uint16_t) &DDRC,
(uint16_t) &DDRD,
(uint16_t) &DDRA,
};

const uint16_t PROGMEM port_to_output_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
(uint16_t) &PORTB,
(uint16_t) &PORTC,
(uint16_t) &PORTD,
(uint16_t) &PORTA,
};

const uint16_t PROGMEM port_to_input_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
(uint16_t) &PINB,
(uint16_t) &PINC,
(uint16_t) &PIND,
(uint16_t) &PINA,
};

const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PD, /* 0 /
PD,
PD,
PD,
PD,
PD,
PD,
PD,
PB, /
8 /
PB,
PB,
PB,
PB,
PB,
PC, /
14 */
PC,
PC,
PC,
PC,
PC,
PA,
PA,
PA,
PA,
};

const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
_BV(0), /* 0, port D _/
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(6),
_BV(7),
BV(0), / 8, port B _/
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
BV(0), / 14, port C _/
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
BV(0), / 20, Port A */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
};

const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
NOT_ON_TIMER, /* 0 - port D /
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
// on the ATmega168, digital pins 5 and 6 have hardware pwm
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER, /
8 - port B /
TIMER1A,
TIMER1B,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER, /
14 - port C */
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,

};

@TCWORLD
Copy link
Owner

TCWORLD commented Nov 26, 2014

For Port A, you would need them to take this format:

const uint16_t PROGMEM port_to_mode_PGM[] = {
  NOT_A_PORT,
  (uint16_t) &DDRA,
  (uint16_t) &DDRB,
  (uint16_t) &DDRC,
  (uint16_t) &DDRD,
};

The same layout for the output and input registers.

@TCWORLD
Copy link
Owner

TCWORLD commented Nov 26, 2014

I have just had a look through the pins_arduino.h file and you are correct there are several mistakes in it including the defines for number of pins.
I've made corrections to the file and also added PORTA for you.

@jseaber
Copy link

jseaber commented Nov 26, 2014

Thank you! I'll share results as soon as my ATtiny88 boards arrive.

@jseaber
Copy link

jseaber commented Nov 26, 2014

I think another four pins are missing:

PB6 / PCINT6
PB7 / PCINT7
PC6 / PCINT14//RESET
PC7 / PCINT15

@TCWORLD
Copy link
Owner

TCWORLD commented Nov 26, 2014

B6 and B7 are the oscillator pins. C6 is the reset pin. On the Uno these don't have assigned digital pins.

If you want to assign them digital pin numbers, just assign them at the end of the list of digital pins.

@jseaber
Copy link

jseaber commented Nov 26, 2014

Hm, Atmel makes no mention of XTAL1/XTAL2/TOSX1/TOSC2 in the ATTiny48/88 overview (unless I've missed it).

attiny88

PB6 and PB7 are listed as oscillator pins in the Atmega48/88/168/328 overview:
atmega368

Yes, C6 is unlikely to be used.

@TCWORLD
Copy link
Owner

TCWORLD commented Nov 26, 2014

You're right, it doesn't have XTAL pins. I was just assuming it would be the same as the mega328.
But then I didn't pick the pin assignments for the t88, someone else did that. I'll make some changes.

TCWORLD added a commit that referenced this issue Nov 26, 2014
Changed the pin mapping of the preliminary ATTiny88 support to include missing pins.
@tomscatliff
Copy link
Contributor Author

I got it as far as compiling, but then had to abandon further development.
Sorry, but I've made no progress.

On Wed, Nov 26, 2014 at 5:20 PM, Tom Carpenter notifications@github.com
wrote:

You're right, it doesn't have XTAL pins. I was just assuming it would be
the same as the mega328.
But then I didn't pick the pin assignments for the t88, someone else did
that. I'll make some changes.


Reply to this email directly or view it on GitHub
#22 (comment).

@techydude
Copy link

TC, while you're at it, in light of this t88 pins_arduino.h issue, I've noticed strangeness with the t87/167 too, mainly with which pins have / can-have PWM, wondering if you can take a look?

I'm not au fait enough with how Arduino can make use of the available hardware-pwm-capable pins (for example the t87/167 has 9 OC-capable pins, 1 for Timer0 on PA2, & 8 for Timer1 on all of PBx), but less than half of those have been defined in pins_arduino.h, & they don't even line up:

t87/167's pins_arduino.h says Arduino Pins 2, 3, 4, & 5 are PWM. yet AFAIK that corresponds to:

Arduino-Pin2 = PB6 (OC1AX), yet when I "analogWrite(2, 0x7f)" I don't get PWM output;
Arduino-Pin3 = PA3 = no OC-pin capability!
Arduino-Pin4 = PB0 (OC1AU), but again when I "analogWrite(4, 0x7f)" I don't get PWM output;
Arduino-Pin5 = PB1 (OC1BU), but again when I "analogWrite(5, 0x7f)" I don't get PWM output;

These 2/3/4/5 Arduino-Pin # also contradict the chip-diagram with the * denoting which ones are PWM.

This SEEMS to my untrained eye to be all to do with the 'digital_pin_to_timer_PGM' array only having 2 entries, and it seems to be in some 'random' order I can't work out:

const uint8_t PROGMEM digital_pin_to_timer_PGM[] =
{
NOT_ON_TIMER,
NOT_ON_TIMER,
TIMER1A,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
TIMER1B,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
};

And I don't understand what appears to be two different references to Timers in Arduinoland: in t87/167 there's just the 2, Timer0 & Timer1, other ATmegas have Timer2 & even Timer3 too I think, but most Arduino-standard pins_arduino.h files (for larger pin-count AVRs & where Arduino have defined PWM support on more than just a few pins, e.g. Uno, & particularly Mega) they seem to reference TIMER1A, TIMER1B, TIMER2A, TIMER2B, TIMER3A, TIMER3B, TIMER4A, TIMER4B, etc - that is, well above the actual number of hardware timers. Can you point me to where else in Arduino source files this is abstracted?

If I can wrap my head around this (if you can point me to where there might be some doco?), I'd be happy to make a corrected pins_arduino.h, because I've made some other mods to the t87/167 support too, for supporting the 2.56V analog reference, instead of just the 1.1V ref, which I'd like to PR back into this project.
Thanks, Anthony.

@TCWORLD
Copy link
Owner

TCWORLD commented Nov 27, 2014

The tX7 variants are a bit tricky. Basically while yes there are 8 pins on Timer1 capable of PWM, there are only two PWM generators - using TCCR1D you can select which pins are enabled. You could have all 8 enabled, but each of the two groups of 4 would have the same PWM out (not individually controlled). I picked two to use. I think I also added something into the init() function for the X7 to set the correct bits of TCCR1D, but I can't remember - I may not have done, it may be something you have to add at the start of your sketch.
Timer0 also got confusing as there are only defines for TIMER0A and TIMER0B, but this timer doesn't have an A/B. At the time I wasn't sure whether to add a new TIMER0 define and work out how to set that up - but then other priorities took over and I never got around to it.

@techydude
Copy link

riiiight, this is starting to make sense now. i can't believe I missed that most basic limitation on page1 of the datasheet facepalm.
i suppose I could do timer-interrupt-based 'bit banging' PWM. i think there might even be an Arduino library for that.
thanks, shall dig deeper.

@jseaber
Copy link

jseaber commented Dec 4, 2014

Programming the ATTiny88 via ISP was successful on the first try. Pin mapping seems to be perfect! I've tested pins PD3, PA3, PB6, PB7, PD5, PB1, PC7, and PD2. Since at least one pin of each port is correct, I think it's safe to assume all digital pins are correctly implemented.

Analog inputs will be tested tomorrow (more soldering to do on my part first...).

Here's the full pin mapping (hopefully saves time for others):

// ATTINY88 PINOUT
int pinD0 = 0;
int pinD1 = 1;
int pinD2 = 2;
int pinD3 = 3;
int pinD4 = 4;
int pinD5 = 5;
int pinD6 = 6;
int pinD7 = 7;
int pinB0 = 8;
int pinB1 = 9;
int pinB2 = 10;
int pinB3 = 11;
int pinB4 = 12;
int pinB5 = 13;
int pinB6 = 14;
int pinB7 = 15;
int pinC0 = 16;
int pinC1 = 17;
int pinC2 = 18;
int pinC3 = 19;
int pinC4 = 20;
int pinC5 = 21;
int pinC6 = 22;
int pinC7 = 23;
int pinA0 = 24;
int pinA1 = 25;
int pinA2 = 26;
int pinA3 = 27;

@jseaber
Copy link

jseaber commented Dec 11, 2014

Analog inputs seem to be broken. Each pin value is about 355, regardless of input. Only A0-A5 are implemented, but functionality is more pressing...

Is there a trick to initializing the ADC? I set line 42 in pins_arduino.h to 1:
#define INITIALIZE_ANALOG_TO_DIGITAL_CONVERTER 1

The tinyX7/pins_arduino.h contains additional code. Perhaps this is missing?

//Please define the port on which the analog comparator is found.
#define ANALOG_COMP_DDR DDRA
#define ANALOG_COMP_PORT PORTA
#define ANALOG_COMP_PIN PINA
#define ANALOG_COMP_AIN0_BIT 6
#define ANALOG_COMP_AIN1_BIT 7
/*
Analog reference bit masks.
*/
// VCC used as analog reference, disconnected from PA0 (AREF)
#define DEFAULT (0)
// External voltage reference at PA0 (AREF) pin, internal reference turned off
#define EXTERNAL (1)
// Internal 1.1V voltage reference
#define INTERNAL (2)

@TCWORLD
Copy link
Owner

TCWORLD commented Dec 11, 2014

You will need to define the references in the header, they were missed. If you look in the datasheet for the ADC it describes what value corresponds to what reference source.

The analog comparator additions can be added as well, but they are for if software serial is enabled as that is used as an interrupt source for serial comms. It has no bearing on the ADC.

You will need to compare the ADC registers between the tinyX8 and say tinyX4 data sheets and see if the register names/functions are similar. If they are then the existing code for the ADC should work. If they are very different then core code will have to be modified.

(p.s. I'd use the tinyX4 header as a reference and the X7's are a bit funky).

@jseaber
Copy link

jseaber commented Dec 11, 2014

Ah yes, x4 differs from x8:

x4_bits

x8_bits

I'll try:

#define DEFAULT (1)
#define INTERNAL (0)

@jseaber
Copy link

jseaber commented Dec 11, 2014

No success with:
#define DEFAULT (1)
#define INTERNAL (0)

Perhaps this is caused by register bit 7 only accepting a read condition for ATTiny88, whereas ATTiny84 accepts read/write. Core problem?

TCWORLD added a commit that referenced this issue Dec 15, 2014
Pin mapping changed slightly.
Added empty bootloader files.
Updated boards.txt to include millis.
Fixed wiring.c to work with ATiiny88 timer 0 peculiarities.
Fixed the wiring_analog.c code to work with ATiiny88 ADC.
@TCWORLD
Copy link
Owner

TCWORLD commented Dec 15, 2014

Try the ADC now.

TCWORLD added a commit that referenced this issue Dec 15, 2014
Updated comments in file to match changes made in commit #c9bbf7c
@jseaber
Copy link

jseaber commented Dec 15, 2014

Okay, I updated the test sketch. Digital pin functionality remains okay (although PC7 was axed).

When applying a 2.5VDC input to ADC1:

*tiny core returns constant ADC readings of 0
*tinyNoMillis core generates constant readings of 1023

@TCWORLD
Copy link
Owner

TCWORLD commented Dec 15, 2014

Double check the mappings as I had to make some changes.

@jseaber
Copy link

jseaber commented Dec 15, 2014

Mappings are up to date. The sketch is as simple as possible. I'm manipulating the "SupplyVoltage > 1" condition to light a red or white LED.

// Testing ATTiny88 ADC
int WhiteLED = 9; // Pin to drive white LED, wired to PB1
int RedLED = 3; // Pin to drive red LED, wired to PD3
int VTEST_ADC = A1; // Pin to read voltage at ADC1. Hardware measures about 2.5V

// TEMPORARY VARIABLES
float SupplyVoltage = 0; // Temp variable to read supply voltage. Scale by 1023.

void setup()
{
pinMode(WhiteLED, OUTPUT);
pinMode(RedLED, OUTPUT);

digitalWrite(WhiteLED, HIGH);
digitalWrite(RedLED, HIGH);
}

void loop()
{
SupplyVoltage = (float)analogRead(VTEST_ADC)*5.0/1023; // Note: Assumes 5V rail measures exactly 5.00V
if(SupplyVoltage > 1){ // Test input of 2.5V should light White LED
digitalWrite(WhiteLED, HIGH);
digitalWrite(RedLED, LOW);
}
else{ // Else: Light Red LED
digitalWrite(WhiteLED, LOW);
digitalWrite(RedLED, HIGH);
}
// delay(100);
}

@TCWORLD
Copy link
Owner

TCWORLD commented Dec 15, 2014

I was just meaning with regards to PC7, that is now digital pin 16.

Could you try Serial out for me. Just do Serial.begin(9600); and Serial.println("Hello"); See if you get any output in the serial monitor. The pin mappings (relative to the Attiny) are TX = PD6 (Digital 6) and RX = PD7 (Digital 7).
If that works, you can Serial.println(analogRead(A1));

@jseaber
Copy link

jseaber commented Dec 15, 2014

I think I fixed it. Line 67 in the pins_arduino.h should be:
#define DEFAULT (1)

See posts above. DEFAULT(0) sets a 1.1V reference. DEFAULT(1) sets AVcc reference for ATTiny X8, which is opposite of the ATTinyX4.

'tiny' core now works, tested with ADC1 and ADC2.
'tinyNoMillis' core's ADC is still broken.

The ATTiny88 lacks TX and RX pins, so no serial :-( I'm uploading code via ISP.

PC7: Noted. I'll update my production code and test other pins.

@TCWORLD
Copy link
Owner

TCWORLD commented Dec 15, 2014

Will correct that.

The ATTinyCore has build in software serial routines using the Analog Comparator as an interrupt source. You should be able to use Serial on the two pins I mentioned.

@jseaber
Copy link

jseaber commented Dec 15, 2014

Oh right, I'll give that a try.

@TCWORLD
Copy link
Owner

TCWORLD commented Dec 15, 2014

Latest commit 7d71ca2 should make analogRead() with no-millis core work. The ADC was not being initialised in that core - so in fact analogRead() in the no millis core won't have worked with any device.
Also corrected the analog reference defines.

TCWORLD added a commit that referenced this issue Dec 15, 2014
Corrected the Extended Fuse setting.
@jseaber
Copy link

jseaber commented Dec 15, 2014

tinyNoMillis is confirmed working with analogRead(), and PC7 tests okay.

Serial: Will report back as soon as I can. Something went wrong with my soldering, and I just about blew the USB bus.

TCWORLD added a commit that referenced this issue Dec 15, 2014
Name of the empty bootloader file for ATTiiny88 was wrong. This is
fixed.
TCWORLD added a commit that referenced this issue Dec 15, 2014
Added entries and modification for ATTiny88 into the UECIDE core.
@jseaber
Copy link

jseaber commented Dec 15, 2014

Confirmed: Serial and ADC are working!

Here's a screenshot of the serial monitor printing a variable holding ADC output. Multimeter measured 2.84V, and the ADC agrees:

attiny88_adc

@TCWORLD
Copy link
Owner

TCWORLD commented Dec 16, 2014

Excellent. I'm going to mark this issue closed for the time being, but if there are any more issues with the Attiny88 that anyone finds, feel free to open this again.

@TCWORLD TCWORLD closed this as completed Dec 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants