UPDI--Configuring with fuse setting??

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

I'm using an Attiny1614 and want to share UPDI with an input.

 

The spec talks about the UPDI programming mode being based on a fuse setting.  But, how does one set a fuse, except through the programming interface?

 

I'm using an Atmel-Ice for programming.  When I used it for a project last fall, I think it just worked.  I don't recall having to set a fuse or do anything special.   Maybe it uses the high voltage method by default.

 

That's ok, the shared input won't be connected to anything during programming.

 

I just want to make sure UPDI can safely be shared with another input.  

 

Based on this thread:

 

https://www.avrfreaks.net/forum/sharing-updi-programming-pin-digital-input-problem-programming?skey=share%20UPDI

 

I think it can.  

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

AVRs can never write their own fuses (though some offer run time change of lockbits). So you always have to use the programming interface.

davethomaspilot wrote:
I don't recall having to set a fuse or do anything special. 
Which would seem to suggest that the default setting must have been OK for you.

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

davethomaspilot wrote:
I just want to make sure UPDI can safely be shared with another input.  

 

It can, but if it's in UPDI mode, both the CPU and the UPDI unit will react to the input. So, if the input is meaningful to the UPDI unit, it will execute whatever the input tells it to. Of course, most inputs will not have meaning to the UPDI unit.

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

AVRs can never write their own fuses (though some offer run time change of lockbits). So you always have to use the programming interface

Yeah, that's what I was thinking.  But isn't that a bit of "chicken and the egg"?  From the AT1614 spec:

 

UPDI Enable with Fuse Override of RESET Pin When the RESET Pin Configuration (RSTPINCFG) bits in FUSE.SYSCFG0 are 0x1, the RESET pin will be overridden, and the UPDI will take control of the pin and configure it as input with pull-up

I think the ONLY programming interface is UPDI.  So, how does fuse ever get set?

 

 

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

Yeah, I saw that discussion about UPDI always watching the input for valid commands.

 

In my case, it will be shared by a repetitive pulse at a frequency 50x slower than the processor clock frequency.  Seems unlikely that could be interpreted as a valid UPDI command.

 

Seems like I could also have code to disable UPDI based on the state of another input.  Initialization code would look at that input, then disable UPDI unless it's in the "Let's program!" state.

 

Thanks.

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

Isn't this quite similar to DebugWire? It is turned on and off by fuse and shares a pin with reset. Of course, in normal operation, that does not have much impact since nothing much plays with that, UNLESS you have RSTDBL turned on.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

In "normal operation", debugWire is not active, at least in the Attiny's I've used.  It needs to be enabled by ISP and typically used just for debugging (though you can program through that interface).

 

But, now that you mention it, I think it would give me headaches while debugging with the ICE.  In that case, debug data from the chip would collide with the shared input.

 

So, seems like not such a good idea if you want to keep the option of debugging in the system.

 

The ATTiny1614 has no other programming interface other than UPDI.  So, I don't see how a fuse configuration is useful.  

Last Edited: Tue. Apr 7, 2020 - 03:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Turning it off would reduce power consumption.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

It seems if one more I/O is needed, it is best to seek other solutions then to use the programming/debug pin!

How are the other pins used, perhaps we can suggest another way to configure i/o to free up a pin for your needed input.

Jim

 

 

 

 

 

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

Thanks for the offer, but I don't think I need help with that.

 

Application needs 4 WO and TWI.  I wanted to use a LUT with one input for simple in-out buffer function. 

 

There is  only one LUT input available (if you use TWI on the ALT pins --necessary to have 4 WO outputs).

 

I'll just add a small device for the buffer instead.

 

Thanks!

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

ki0bk wrote:
if one more I/O is needed, it is best to seek other solutions then to use the programming/debug pin!

Absolutely!!

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

What stage of design are you at?  Perhaps using a 20 pin ATtiny1616 instead would be a better solution than adding external circuitry for the buffer.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

Don't need extra GPIO--I have "spares" on the 1614.

 

I need a LUT input for CCL.  The only one available if you use alternate TWI0 is LUT0--and that's on the same pin as UPDI:

 

 

The ATTiny1616 has the same limitation.

 

 

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

davethomaspilot wrote:
I need a LUT input for CCL.  The only one available if you use alternate TWI0 is LUT0

 

But you can route any pin to LUT0-IN0 via the event system, I think. Assuming the needed event channel is free.

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

 

El Tangas wrote:

davethomaspilot wrote:

I need a LUT input for CCL.  The only one available if you use alternate TWI0 is LUT0

 

But you can route any pin to LUT0-IN0 via the event system, I think. Assuming the needed event channel is free.

Exactly, you don't have to use the hardwired inputs or outputs of the LUTs, they are easily reconfigured via the event system.

 

Well the thread started out with you wanting to know if you could share the UPDI pin with an input, which lead many of us to believe that you needed another input pin.  Now that we know that you need a LUT input for a buffer, this has become quite easy to solve.  Hope my definition of buffer matches yours.  The information below is almost the same as a one button hardware debounce I created while studying these chips a couple of years ago.  It included an RS latch in the CCL.  Read on for the buffer...

 

I created a Start project with an ATtiny1616, I have only used the pins available on the 1614.  I added the timer, event system, ccl, and i2c.  Set up the peripheral pins and PINMUX per your table.  Added an input on PB6 for BufferIn and used the LUTO output on PA4 for BufferOut.  If you don't use Start then you can figure out the registers needed from the screenshots or you can create a Start project and fill in the blanks like shown below, then the registers that you need to assign values to are shown by hovering over the question marks beside each of the items in the configuration pages.

 

PINMUX 

 

 

Event_System_0 is configured as this (only showing relevant info)

 

 

Event System Configurator

 

 

 

The CCL

 

 

The CCL Configurator  Note: Since we are using only one input to LUT0, "AND", "OR", or even a Custom logic definition could have been used as the Gate Type.  

 

 

 

 

 

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Wed. Apr 8, 2020 - 08:44 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Honestly, I forgot about the ability to route inputs via EVSYS.  Which is silly, because I used it (albeit for the first time) just last fall.

 

Thanks!

 

As an aside, the start tool likes pretty neat.  I vaguely recall seeing it somewhere, maybe as an installation candidate.

 

Is it a standalone application, or is it a part of Atmel Studio 7?

 

 

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

Disregard question about Start--seems well documented including tutorial on web.

 

I was just too anxious to start my project to learn about start smiley

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

I found the CCL LUTs with so many inputs, logic table combinations, flip-flops, and latches, combined with the ability to cascade to another stage of LUTs to be a gift from the digital logic deities.  The only limitation is finite event channels and CCLs in the chip.

 

Good luck with your project!

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Wed. Apr 8, 2020 - 06:51 PM