ATtiny40 Atmel Corporation, ATtiny40 Datasheet - Page 162

no-image

ATtiny40

Manufacturer Part Number
ATtiny40
Description
Manufacturer
Atmel Corporation
Datasheets

Specifications of ATtiny40

Flash (kbytes)
4 Kbytes
Pin Count
20
Max. Operating Frequency
12 MHz
Cpu
8-bit AVR
# Of Touch Channels
12
Hardware Qtouch Acquisition
Yes
Max I/o Pins
18
Ext Interrupts
18
Usb Speed
No
Usb Interface
No
Spi
1
Twi (i2c)
1
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
12
Adc Resolution (bits)
10
Adc Speed (ksps)
15
Analog Comparators
1
Resistive Touch Screen
No
Temp. Sensor
Yes
Crypto Engine
No
Sram (kbytes)
0.25
Self Program Memory
NO
Dram Memory
No
Nand Interface
No
Picopower
No
Temp. Range (deg C)
-40 to 85
I/o Supply Class
1.8 to 5.5
Operating Voltage (vcc)
1.8 to 5.5
Fpu
No
Mpu / Mmu
no / no
Timers
2
Output Compare Channels
4
Input Capture Channels
1
Pwm Channels
2
32khz Rtc
No
Calibrated Rc Oscillator
Yes

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
ATtiny40-MMHR
Quantity:
6 000
20.4.3.2
20.4.3.3
20.4.3.4
20.4.3.5
162
ATtiny40
Erasing the Code Section
Writing Flash Code Words
Erasing the Configuration Section
Writing a Configuration Word
The algorithm for erasing all pages of the Flash code section is as follows:
The algorithm for writing four words to the code section is as follows:
The algorithm for erasing the Configuration section is as follows:
The algorithm for writing a Configuration word is as follows.
1. Write the SECTION_ERASE command to the NVMCMD register
2. Start the erase operation by writing a dummy byte to the high byte of any word location
3. Wait until the NVMBSY bit has been cleared
1. Write the CODE_WRITE command to the NVMCMD register
2. Write the low byte of the 1st word to the low byte of a target word location
3. Write the high byte of the 1st word to the high byte of the same target word location
4. Send IDLE character as described in section
5. Write the low byte of the 2nd word to the low byte of the next target word location
6. Write the high byte of the 2nd word to the high byte of the same target word location.
7. Send IDLE character as described in section
8. Write the low byte of the 3rd word to the low byte of a target word location
9. Write the high byte of the 3rd word to the high byte of the same target word location
10. Send IDLE character as described in section
11. Write the low byte of the 4th word to the low byte of the next target word location
12. Write the high byte of the 4th word to the high byte of the same target word location.
13. Wait until the NVMBSY bit has been cleared
1. Write the SECTION_ERASE command to the NVMCMD register
2. Start the erase operation by writing a dummy byte to the high byte of any word location
3. Wait until the NVMBSY bit has been cleared
1. Write the CODE_WRITE command to the NVMCMD register
2. Write the low byte of the data word to the low byte of the configuration word location
3. Write the high byte of the data word to the high byte of the same configuration word
4. Send IDLE character as described in section
5. Write a dummy byte to the low byte of the next configuration word location
6. Write a dummy byte to the high byte of the same configuration word location.
7. Send IDLE character as described in section
inside the code section
This will start the Flash write operation
inside the configuration section
location
“Supported Characters” on page 147
“Supported Characters” on page 147
“Supported Characters” on page 147
“Supported Characters” on page 147
“Supported Characters” on page 147
8263A–AVR–08/10

Related parts for ATtiny40