ATtiny40 Atmel Corporation, ATtiny40 Datasheet - Page 163

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.4
20.4.5
20.5
20.6
20.6.1
20.6.2
8263A–AVR–08/10
Self programming
External Programming
Reading NVM Lock Bits
Writing NVM Lock Bits
Entering External Programming Mode
Exiting External Programming Mode
The Non-Volatile Memory Lock Byte can be read from the mapped location in data memory.
The algorithm for writing the Lock bits is as follows.
The ATtiny40 doesn't support internal programming.
The method for programming the Non-Volatile Memories by means of an external programmer is
referred to as external programming. External programming can be done both in-system or in
mass production.
The Non-Volatile Memories can be externally programmed via the Tiny Programming Interface
(TPI). For details on the TPI, see
external programmer can access the NVM control and status registers mapped to I/O space and
the NVM memory mapped to data memory space.
The TPI must be enabled before external programming mode can be entered. The following pro-
cedure describes, how to enter the external programming mode after the TPI has been enabled:
Refer to the Tiny Programming Interface description on
of enabling the TPI and programming the NVM.
Clear the NVM enable bit to disable NVM programming, then release the RESET pin.
8. Write a dummy byte to the low byte of the next configuration word location
9. Write a dummy byte to the high byte of the same configuration word location.
10. Send IDLE character as described in section
11. Write a dummy byte to the low byte of the next configuration word location
12. Write a dummy byte to the high byte of the same configuration word location. This will
13. Wait until the NVMBSY bit has been cleared
1. Write the CODE_WRITE command to the NVMCMD register.
2. Write the lock bits value to the Non-Volatile Memory Lock Byte location. This is the low
3. Start the NVM Lock Bit write operation by writing a dummy byte to the high byte of the
4. Wait until the NVMBSY bit has been cleared.
1. Make a request for enabling NVM programming by sending the NVM memory access
2. Poll the status of the NVMEN bit in TPISR until it has been set.
start the Flash write operation
byte of the Non-Volatile Memory Lock Word.
NVM Lock Word location.
key with the SKEY instruction.
“Programming Interface” on page
“Supported Characters” on page 147
page 145
for more detailed information
145. Using the TPI, the
163

Related parts for ATtiny40