Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : defaultPin
Author | Message | ||||
Nathan Regular Member Joined: 10/01/2016 Location: GermanyPosts: 49 |
Please let me present defaultPin V1.0. It is a C-Function, which sets all unfonfigured pins to one of the following modes or just output the unconfigured pins. ' mode: function: ' 0 print actual unconfigured pins ' 1 input, pull down ' 2 input, pull up ' 3 output, low ' 4 output, high defaultPin(mode) supported are 28, 44 and theoretically also 64 and 100 pin package. Unfortunately I could not check functionality for 64 and 100pin packages, yet. I would be happy about feedback for the devices. The console pins will not be set by the function. At the end of the attached c-function is the black list for the device pins, which are ignored by the function. 2016-05-15_222817_defaultPin_V1.0.zip I would also be happy about users, which use MBASIC special functions like count, I2C .... A short Usage Example: defaultPin(0) Output on Console: 001 002 003 004 005 008 009 010 011 013 015 ... defaultPin(1) defaultPin(0) --> no output, all unfonfigured pins are set to inpt, pull down Background: ------------ A io-buffer (pin), which is not configured. Is in a high-Z state, which may generate a cross current within the input P/N-Fet transistor pair. This can cause unexpected cross current and reduction of liftetime. If possible avoid floating conditions as much as possible. Have fun, Nathan |
||||
Zonker Guru Joined: 18/08/2012 Location: United StatesPosts: 761 |
Interesting info about unused pins in our designs and a very useful Cfunction..!! Thanks Nathan.. |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3167 |
No, this is not an issue with the Micromite. All pins have a Schmitt Trigger input so they are either on or off and never in a half way state. However, grounding unused pins makes them immune to static discharge. Geoff Geoff Graham - http://geoffg.net |
||||
Nathan Regular Member Joined: 10/01/2016 Location: GermanyPosts: 49 |
Hi Geoff, the schmitttriger circuits are enabled in case the pins are configured as digital input. Please take a look into Chapter 12 of the design manual regarding configuration and state of the ports. My explanation with the two transistor model is a little bit to simple. A real estimation would be possible only with an exact knowledge of the transistor circuit structure. In case the schmitttriger is enabled. We are talking about cmos and not bipolar transistor circuits. The activation energy is very low for cmos. Immunity against discharge should be independent of the state of a device. The human body and machine model will be tested without power connection, mostly. It is a pin to pin check. A good designed device survices > 2KVolt pulses(following the spec). Some applications requires > 4KV. There is an ISO norm for this available. Nathan |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3167 |
Any unconfigured pins are set as digital inputs. Thanks but I do know how to configure the I/O ports and I have read the manual. Geoff Graham - http://geoffg.net |
||||
atmega8 Guru Joined: 19/11/2013 Location: GermanyPosts: 712 |
Geoff, that's typicall german behaviour, sorry https://en.wikipedia.org/wiki/Nathan_the_Wise Nathan the Wise |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3167 |
Sorry, yes I should have realised it was just a cultural thing. Nathan's program is great but I don't want people concerned that there is a design fault. Floating pins are OK except if ESD is a concern and then they should be grounded. That was an interesting link to the Ring Parable. Thanks. Geoff Geoff Graham - http://geoffg.net |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
I am from the Netherlands and if Germans are known for something (except drinking beer ) then it is the attention to detail! There are lots of little details hidden in the hundreds of pages of datasheet and this one was new for me. Good to see that it was handled. Microblocks. Build with logic. |
||||
atmega8 Guru Joined: 19/11/2013 Location: GermanyPosts: 712 |
Soccer Microblocks Soccer;-) |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
1974 still hurts! Microblocks. Build with logic. |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2294 |
over on the HP calculator museum forums the members frequently have brawls over quite innocent cultural and linguistic misunderstandings. we are talking about blood on the floor, broken bones, and the occasional death. and i must confess, that i myself can at times be a tad acerbic. plus i use obscure words far too often! in person i am far more mild-mannered. cheers, rob :-) |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1421 |
I'll add acerbic to my vocab. Trenchant and caustic were lonely. Micromites and Maximites! - Beginning Maximite |
||||
Nathan Regular Member Joined: 10/01/2016 Location: GermanyPosts: 49 |
Hmmm, interesting discussion. Some days offline and completely off topic. So lets start. 1.) Documentation of the microcontroller. > Chapter 12 also contains recommentdation about the open pin handling > IT also has drawings about the port structure --> MicroBlocks 2.) Nathan the Wise. Thanks for the flowers, do you know the story? "Nathan the Wise" by Gotthold Ephraim Lessing in 1779. (performance was forbidden for a long time) Next try. 3.) Nathan's program is great but I don't want people concerned that there is a design fault. --> There is no design fault. --> A floating pin has to be avoided, so the user has to take care, to clamp it or to set it to output. There is a cross current in other case. Please use a search engine and take a look onto the pictures. CMOS uses other circuts then bipolar transistors. CMOS uses move of the switch levels. 4.) the only important point for me: Does the function works with 64 and 100 pin chips? Nathan |
||||
Nathan Regular Member Joined: 10/01/2016 Location: GermanyPosts: 49 |
Microchip has a very good document on their download page. Please search for: AN1785 Document title: "ESD and EOS Causes, Differences and Prevention" The document is brilliant and completely matches with the things I'm seeing at work. Regarding unused pins, please take a look onto page 20. On page 28 is a LEM picture, which looks very similar to the situation of a floating unused pin inverter transistor pair. (smaller ones, the big one is a damage) small add on: There is an other Microchip document, which is also helpfull search for AN1416 Title: "Low-Power Design Guide" It explains a lot about the technology, too. Actual main process modes are 40nm, 28nm and 16nm and are not covered (document is of 2011) but it is still helpfull. Nathan |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3167 |
That paper and everything that you have been talking about refers to normal CMOS inputs. The PIC32 has Schmitt trigger inputs. Geoff Graham - http://geoffg.net |
||||
Nathan Regular Member Joined: 10/01/2016 Location: GermanyPosts: 49 |
Hi Geoff, sorry the Schmitt trigger situation is very similar to the inverter. It only depends a little bit on implementation. VDD | +--+ p1 p3 + +Va p2 +----------output n1 +--+ n2 n3 + +Vb | VSS p - p-channel fet n - n channel fet gates of p1, p2, n1, n2 are tied together and are the input. p1, p2,n1,n2 are in series connected. p3 and n3 are switched in parallel depends of level at output and build up the Schmitt trigger by moving the switch level. (circuit for this is not drawn). There are different possibilites for connection and control of n3, p3 and depends on IO library and patent situation. Every vendor has a little bit different implementation for Va, Vb. Cross current between n1, n2, p1, p2 is the point and this depends on the gate voltage, which is the same for all 4 transistors. There is also a nice discussion on electronics.stackexchange.com look for "general rule of thumb for unused ic pins" ST also has a nice document: AN3430 title: "Application note How to achieve the lowest current consumption with STM32F2xx" page 6, shows port structure with schmitt trigger input page 7, recommendation for open input Please let us stop this discussion. I only want to know if it works for 66 and 100 pin package. No one must use the function. Nathan |
||||
Print this page |