Failed to switch ATTiny212/416 PA0 into GPIO

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I'm a TinyAVR user and my evaluation board is "ATtiny416 Xplained Nano", I would like to switch the PA0 of ATTiny212 or ATTiny416 as a GPIO, refer to the link  https://microchipdeveloper.com/8avr:avrfuses,

I followed the steps to modify  SYSCFG0 from 0xC5(UPDI) to  0xC1(GPIO) through Device programming tool of  AtmelStudio 7.0(IDE), it showed verify failed and the modification doesn't work, but except the PA0, all other function switching works, so I wonder if anything I missed here.

Any suggestion is appreciated,

thanks.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The firmware on the xplained nano will usually ignore writes that disables updi , as it would make the kit pretty dead.

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi meolsen,

Thank you for your feedback, I think I can understand your point that xplained nano ignores it for the safety, but in my design, I require PA0 to be GPIO after debug, I would like to make sure if this pin(PA0) can be set as GPIO, how can I program this fuse? actually, I've prepared many backup chips to replace the chip on board, but so far I couldn't find the way to program it successfully.

Are there any way to break the limit to write this fuse? or any other way to make it?

Last Edited: Wed. Aug 14, 2019 - 02:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The reason the onboard debugger won't let you change the RSTPINCFG fuse is because it would need to apply a high voltage pulse to change it back again, and that debugger doesn't support that. So basically you have to use an external programmer/debugger tool, like PICKit4, SNAP, AtmelICE or PowerDebugger. Any of those will let you do it. Only PICKit4 and PowerDebugger supports the high voltage pulsing and will be able to change the fuse back again though.

 

This pdf, http://ww1.microchip.com/downloads/en/DeviceDoc/ATtiny416_Xplained_Nano_Schematics.pdf, has the schematic and the board layout for the kit. Basically you need to remove R200 and connect your external tool on the pad on the target side (in addition to Vcc and GND of course).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is a way to bypass all that "safety", but you will have to modify the EEPROM content of the debugger using its JTAG port.  Its for the 817mini, but should apply to the 416nano too...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

CalvinLin wrote:
I'm a TinyAVR user and my evaluation board is "ATtiny416 Xplained Nano", I would like to switch the PA0 of ATTiny212 or ATTiny416 as a GPIO

 

I think most of the people here missed the point, the OP's end product uses ATTiny212, the ATting416 Xplained Nano is just for evaluation purposes.

 

I suppose the question is, whether you can use PA0 as GPIO, yes you can...but before, please check this thread:

 

https://www.avrfreaks.net/forum/...

 

The mystery around using the UPDI pin/PA0 as a GPIO:

if you want to use UPDI pin as an input GPIO, its possible, but then you will not be able to read the input after flashing your program (GPIO/input mode)

If you want to use UPDI pin as an output GPIO, its possible, but then you need to configure the FUSE as for UPDI as output and in this case, you can not go back to UPDI mode except by using 12V programming.

 

best case: Leave the UPDI alone...if your application requires more pins, use an alternative like Attiny214...it cost a few cents more

 

EDIT: a valuable comment for the procedure of 12V programming:

https://www.avrfreaks.net/commen...

 

Last Edited: Wed. Aug 14, 2019 - 07:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

je_ruud wrote:

The reason the onboard debugger won't let you change the RSTPINCFG fuse is because it would need to apply a high voltage pulse to change it back again, ....

 

Does it mean that I couldn't program the RSTPINCFG fuse with the onboard debugger no matter what, because the "Device programming" tool locked it as the on board debugger is not able to provide 12V, So I definitely need to program this fuse by the external debugger from UPDI/RESET to GPIO?

 

Moe123 wrote:

I suppose the question is, whether you can use PA0 as GPIO, yes you can...but before, please check this thread:

Actually I couldn't switch the UPDI of ATtiny212/416 to PA0 so far, by program the RSTPINCFG with "Device programming" tool, it showed verify failed.

And I am probably not able to use the ATTiny214 since all the features of ATtiny212 fits my need but the unsuccessfully assigned PA0, so I prefer to figure out the way to set it as GPIO, the set back of functionality of PA0 is not the necessary issue currently.