User Tools

Site Tools


microcontroller_annoyances

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
microcontroller_annoyances [2008/06/10 16:37]
pcbgcode High-voltage programming can fix bad fuses too.
microcontroller_annoyances [2016/01/28 18:05] (current)
Line 4: Line 4:
  
 ====== AVRs ====== ====== AVRs ======
 +
  
 ===== Calculating Fuses ===== ===== Calculating Fuses =====
Line 9: Line 10:
 WinAVR is great, better than AVR studio but there'​s no nice fuse selector like there is with AVR studio. Luckily there are two calculators WinAVR is great, better than AVR studio but there'​s no nice fuse selector like there is with AVR studio. Luckily there are two calculators
   - [[http://​www.vonnieda.org/​AVRFuses/​ | AVRFuses]] is a simple fuse programmer for the AVR series of microcontrollers from Atmel. It is written in C#.NET with the intention of being cross platform compatible with Windows, OS X and Linux. It is written to mimic the look, feel and utility of the AVR Studio fuse programmer.   - [[http://​www.vonnieda.org/​AVRFuses/​ | AVRFuses]] is a simple fuse programmer for the AVR series of microcontrollers from Atmel. It is written in C#.NET with the intention of being cross platform compatible with Windows, OS X and Linux. It is written to mimic the look, feel and utility of the AVR Studio fuse programmer.
-  - [[http://palmavr.sourceforge.net/​cgi-bin/​fc.cgi | AVR Fuse Calculator]] is a webpage that does it all +  - [[http://www.engbedded.com/​cgi-bin/​fc.cgi| AVR Fuse Calculator]] is a webpage that does it all 
  
 ===== Fixing fuses ===== ===== Fixing fuses =====
Line 56: Line 57:
  
 So make sure to always use BOD fuses! So make sure to always use BOD fuses!
 +
 +===== EEPROM corruption from brownouts =====
 +Brownouts can cause the first location of the on-board EEPROM to be overwritten.
 +
 +''​In addition to the precautions elsewhere on this Wiki, consider not using the first EEPROM location.''​
 +
  
 ===== Brownout fuses ===== ===== Brownout fuses =====
  
 If the voltage on your chip goes too low it can start executing random instructions,​ or corrupt the flash/​eeprom (see above) so just always set the BOD unless there'​s some good reason not to! If the voltage on your chip goes too low it can start executing random instructions,​ or corrupt the flash/​eeprom (see above) so just always set the BOD unless there'​s some good reason not to!
- 
  
 ===== Reset Pin ===== ===== Reset Pin =====
  
-Not really an annoyance, but just so you know: its not necessary to have a pull-up 10K (or whatever) resistor on the Reset pin, there'​s an internal one already!+Not really an annoyance, but just so you know: Unless your design is in an electrically noisy environment,​ it is not necessary to have a pull-up 10K (or whatever) resistor on the Reset pin, there'​s an internal one already!
  
-(Reference: see "DC characteristics"​ of any AVR datasheet for R_RST 20-100Kohm pull up resisitor)+(Reference: see "DC characteristics"​ of any AVR datasheet for R_RST 20-100Kohm pull up resistor)
  
 For a solid design, follow [[http://​www.atmel.com/​dyn/​resources/​prod_documents/​doc1619.pdf|AVR app note AVR040]]'​s suggestions:​ "To achieve the same protection on Reset as on other I/O pins, an external diode should be connected from Reset to VCC. A normal small-signal diode will do //[ed. 1N914 or 1N4148]//. In addition, a pull-up resistor (10K typical) and a small filter capacitor (4.7 nF) should be connected as shown in Figure 4-7." For a solid design, follow [[http://​www.atmel.com/​dyn/​resources/​prod_documents/​doc1619.pdf|AVR app note AVR040]]'​s suggestions:​ "To achieve the same protection on Reset as on other I/O pins, an external diode should be connected from Reset to VCC. A normal small-signal diode will do //[ed. 1N914 or 1N4148]//. In addition, a pull-up resistor (10K typical) and a small filter capacitor (4.7 nF) should be connected as shown in Figure 4-7."
  
 Note: [[http://​www.atmel.com/​dyn/​resources/​prod_documents/​doc2521.pdf|AVR042]] has more info on reset pin design (as well as overall good advice for hardware design w/AVRs) Note: [[http://​www.atmel.com/​dyn/​resources/​prod_documents/​doc2521.pdf|AVR042]] has more info on reset pin design (as well as overall good advice for hardware design w/AVRs)
 +
 +If you plan to use debugWIRE, the resistor to VCC should be 10K or larger, and there should not be a capacitor to ground. See page 4 of [[http://​www.atmel.com/​dyn/​resources/​prod_documents/​doc2521.pdf|AVR042]] for details.
  
 ===== AVCC ===== ===== AVCC =====
Line 88: Line 96:
 MOSI -> PE0, MISO -> PE1, SCK -> PB1 // --- //​[[http://​www.avrfreaks.net/​wiki/​index.php/​Documentation:​Things_That_Are_Broken|AVR Wiki]]// MOSI -> PE0, MISO -> PE1, SCK -> PB1 // --- //​[[http://​www.avrfreaks.net/​wiki/​index.php/​Documentation:​Things_That_Are_Broken|AVR Wiki]]//
  
 +===== SPI Master mode =====
 +On some (all?) AVRs, if the SPI slave select (SS_) pin is an input and low, then the SPI interface will go into slave mode, even if you have previously selected master mode.  Hope you weren'​t using that pin for something else.
  
 ====== PIC ====== ====== PIC ======
/home/ladyada/public_html/wiki/data/attic/microcontroller_annoyances.1213115836.txt.gz · Last modified: 2016/01/28 18:05 (external edit)