Rainbow-electronics ATtiny15L Instrukcja Użytkownika

Przeglądaj online lub pobierz Instrukcja Użytkownika dla Czujniki Rainbow-electronics ATtiny15L. Rainbow Electronics ATtiny15L User Manual Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 83
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 0
1
Features
High-performance, Low-power AVR
®
8-bit Microcontroller
Advanced RISC Architecture
90 Powerful Instructions – Most Single Clock Cycle Execution
32x8GeneralPurposeWorkingRegisters
Fully Static Operation
Non-volatile Program and Data Memories
1K Byte In-System Programmable Flash Program Memory
Endurance: 1,000 Write/Erase Cycles
64 Bytes EEPROM
Endurance: 100,000 Write/Erase Cycles
Programming Lock for Flash Program Data Security
Peripheral Features
Interrupt and Wake-up on Pin Change
Two 8-bit Timer/Counters with Separate Prescalers
One 150 kHz, 8-bit High-speed PWM Output
4-channel 10-bit ADC
One Differential Voltage Input with Optional Gain of 20x
On-chip Analog Comparator
Programmable Watchdog Timer with On-chip Oscillator
Special Microcontroller Features
In-System Programmable via SPI Port
Enhanced Power-on Reset Circuit
Programmable Brown-out Detection Circuit
Internal, Calibrated 1.6 MHz Tunable Oscillator
Internal 25.6 MHz Clock Generator for Timer/Counter
External and Internal Interrupt Sources
Low-power Idle and Power-down Modes
Power Consumption at 1.6 MHz, 3V, 25°C
Active: 3.0 mA
Idle Mode: 1.0 mA
Power-down: < 1 µA
I/O and Packages
8-lead PDIP and 8-lead SOIC: 6 Programmable I/O Lines
Operating Voltages
2.7V - 5.5V
Internal 1.6 MHz System Clock
Pin Configuration
1
2
3
4
8
7
6
5
(RESET/ADC0) PB5
(ADC3) PB4
(ADC2) PB3
GND
VCC
PB2 (ADC1/SCK/T0/INT0)
PB1 (AIN1/MISO/OC1A)
PB0 (AIN0/AREF/MOSI)
PDIP/SOIC
8-bit
Microcontroller
with 1K Byte
Flash
ATtiny15L
Rev. 1187EAVR06/02
Przeglądanie stron 0
1 2 3 4 5 6 ... 82 83

Podsumowanie treści

Strona 1 - ATtiny15L

1Features• High-performance, Low-power AVR®8-bit Microcontroller• Advanced RISC Architecture– 90 Powerful Instructions – Most Single Clock Cycle Execu

Strona 2

10ATtiny15L1187E–AVR–06/02Figure 11. Single Cycle ALU OperationI/O Memory The I/O space definition of the ATtiny15L is shown in Table 2.System Clock Ø

Strona 3

11ATtiny15L1187E–AVR–06/02Note: 1. Reserved and unused locations are not shown in the table.All ATtiny15L I/O and peripheral registers are placed in t

Strona 4

12ATtiny15L1187E–AVR–06/02• Bit 2 – N: Negative FlagThe Negative Flag N indicates a negative result after the different arithmetic and logicoperations

Strona 5

13ATtiny15L1187E–AVR–06/02The most typical and general program setup for the Reset and Interrupt VectorAddresses are:Address Labels Code Comments$000

Strona 6

14ATtiny15L1187E–AVR–06/02Figure 12. Reset LogicNote: 1. The Power-on Reset will not work unless the supply voltage has been below VPOT(falling).Table

Strona 7

15ATtiny15L1187E–AVR–06/02Notes: 1. On Power-up, the start-up time is increased with typical 0.6 ms.2. “0” means programmed, “1” means unprogrammed.Ta

Strona 8

16ATtiny15L1187E–AVR–06/02Figure 13. “MCU Start-up, RESET Tied to VCCFigure 14. MCU Start-up, RESET Extended ExternallyExternal Reset An External Rese

Strona 9

17ATtiny15L1187E–AVR–06/02Brown-out Detection ATtiny15L has an On-chip Brown-out Detection (BOD) circuit for monitoring the VCClevel during the operat

Strona 10

18ATtiny15L1187E–AVR–06/02MCU Status Register –MCUSRThe MCU Status Register provides information on which reset source caused an MCUReset.• Bit 7..4 –

Strona 11

19ATtiny15L1187E–AVR–06/02Interrupt Handling The ATtiny15L has two 8-bit Interrupt Mask Control Registers: GIMSK (General Inter-rupt Mask Register) an

Strona 12

2ATtiny15L1187E–AVR–06/02Description The ATtiny15L is a low-power CMOS 8-bit microcontroller based on the AVR RISCarchitecture. By executing powerful

Strona 13

20ATtiny15L1187E–AVR–06/02The corresponding interrupt of External Interrupt Request 0 is executed from Programmemory address $001. See also “External

Strona 14

21ATtiny15L1187E–AVR–06/02vector $003) is executed if a compare match A in Timer/Counter1 occurs, i.e., when theOCF1A bit is set (one) in the Timer/Co

Strona 15

22ATtiny15L1187E–AVR–06/02• Bit 1 – TOV0: Timer/Counter0 Overflow FlagThe bit TOV0 is set (one) when an overflow occurs in Timer/Counter0. TOV0 is cle

Strona 16

23ATtiny15L1187E–AVR–06/02• Bits 4, 3 – SM1, SM0: Sleep Mode Select Bits 1 and 0These bits select between the three available sleep modes, as shown in

Strona 17

24ATtiny15L1187E–AVR–06/02ADC Noise Reduction Mode When the SM1/SM0 bits are “01”, the SLEEP instruction forces the MCU into the ADCNoise Reduction mo

Strona 18

25ATtiny15L1187E–AVR–06/02Timer/Counters The ATtiny15L provides two general purpose 8-bit Timer/Counters. The Timer/Countershave separate prescaling s

Strona 19

26ATtiny15L1187E–AVR–06/02The Special Function IORegister – SFIOR• Bit 7..3 – Res: Reserved BitsThese bits are reserved bits in the ATtiny15L and alwa

Strona 20

27ATtiny15L1187E–AVR–06/02Figure 20. Timer/Counter0 Block DiagramThe Timer/Counter0 ControlRegister – TCCR0• Bits 7..3 – Res: Reserved BitsThese bits

Strona 21

28ATtiny15L1187E–AVR–06/02The Timer Counter 0 – TCNT0The Timer/Counter0 is implemented as an up-counter with read and write access. If theTimer/Counte

Strona 22

29ATtiny15L1187E–AVR–06/02The Timer/Counter1 contains two Output Compare Registers, OCR1A and OCR1B, asthe data source to be compared with the Timer/C

Strona 23

3ATtiny15L1187E–AVR–06/02Block Diagram Figure 1. The ATtiny15L Block DiagramPROGRAMCOUNTERINTERNALOSCILLATORWATCHDOGTIMERSTACKPOINTERPROGRAMFLASHHARDW

Strona 24

30ATtiny15L1187E–AVR–06/02• Bits 3, 2, 1, 0 – CS13, CS12, CS11, CS10: Clock Select Bits 3, 2, 1, and 0The Clock Select bits 3, 2, 1, and 0 define the

Strona 25

31ATtiny15L1187E–AVR–06/02Timer/Counter1 OutputCompare RegisterA – OCR1AThe Output Compare Register 1A is an 8-bit read/write register.The Timer/Count

Strona 26

32ATtiny15L1187E–AVR–06/02Figure 22. Effects of Unsynchronized OCR LatchingDuring the time between the write and the latch operation, a read from OCR1

Strona 27

33ATtiny15L1187E–AVR–06/02The frequency of the PWM will be Timer Clock Frequency divided by OCR1B value + 1.The exact duty-cycle of the non-inverted P

Strona 28

34ATtiny15L1187E–AVR–06/02The Watchdog Timer The Watchdog Timer is clocked from a separate On-chip Oscillator that runs at 1 MHz.This is the typical v

Strona 29

35ATtiny15L1187E–AVR–06/021. In the same operation, write a logical “1” to WDTOE and WDE. A logical “1” mustbe written to WDE even though it is set to

Strona 30

36ATtiny15L1187E–AVR–06/02EEPROM Read/WriteAccessThe EEPROM Access Registers are accessible in the I/O space.The write access time is in the range of

Strona 31

37ATtiny15L1187E–AVR–06/02The EEPROM ControlRegister – EECR• Bit 7..4 – RES: Reserved BitsThese bits are reserved bits in the ATtiny15L and will alway

Strona 32

38ATtiny15L1187E–AVR–06/02The user should poll the EEWE bit before starting the read operation. If a write operationis in progress when new data or ad

Strona 33

39ATtiny15L1187E–AVR–06/02The AnalogComparatorThe Analog Comparator compares the input values on the positive pin PB0 (AIN0) andnegative pin PB1 (AIN1

Strona 34

4ATtiny15L1187E–AVR–06/02Pin DescriptionsVCC Supply voltage pin.GND Ground pin.Port B (PB5..PB0) Port B is a 6-bit I/O port. PB4..0 are I/O pins that

Strona 35

40ATtiny15L1187E–AVR–06/02• Bit 3 – ACIE: Analog Comparator Interrupt EnableWhen the ACIE bit is set (one) and the I-bit in the Status Register is set

Strona 36

41ATtiny15L1187E–AVR–06/02The Analog-to-DigitalConverter, AnalogMultiplexer, and GainStagesFeatures • 10-bit Resolution• ±2 LSB Absolute Accuracy• 0.5

Strona 37

42ATtiny15L1187E–AVR–06/02Figure 25. Analog-to-Digital Converter Block SchematicOperation The ADC converts an analog input voltage to a 10-bit digital

Strona 38

43ATtiny15L1187E–AVR–06/02mode, the ADC is constantly sampling and updating the ADC Data Register. The ADFRbit in ADCSR selects between the two availa

Strona 39

44ATtiny15L1187E–AVR–06/02the ADC is switched on by setting the ADEN bit in ADCSR. The prescaler keeps runningfor as long as the ADEN bit is set, and

Strona 40

45ATtiny15L1187E–AVR–06/02Figure 28. ADC Timing Diagram, Single ConversionFigure 29. ADC Timing Diagram, Free Running ConversionSign and MSB of Result

Strona 41

46ATtiny15L1187E–AVR–06/02ADC Noise CancelerFunctionThe ADC features a noise canceler that enables conversion during ADC Noise Reduc-tion mode (see “S

Strona 42

47ATtiny15L1187E–AVR–06/02• Bits 4..3 – Res: Reserved BitsThese bits are reserved bits in the ATtiny15L and always read as zero.• Bits 2..0 – MUX2..MU

Strona 43

48ATtiny15L1187E–AVR–06/02channel must be selected before entering Free Running mode. Selecting an activechannel after entering Free Running mode may

Strona 44

49ATtiny15L1187E–AVR–06/02The ADC Data Register –ADCL and ADCHADLAR = 0ADLAR = 1When an ADC conversion is complete, the result is found in these two r

Strona 45

5ATtiny15L1187E–AVR–06/02ATtiny15LArchitecturalOverviewThe fast-access Register File concept contains 32 x 8-bit general purpose working reg-isters wi

Strona 46

50ATtiny15L1187E–AVR–06/02ADC Noise-cancelingTechniquesDigital circuitry inside and outside the ATtiny15L generates EMI, which might affect theaccurac

Strona 47

51ATtiny15L1187E–AVR–06/02I/O Port B All AVR ports have true read-modify-write functionality when used as general digital I/Oports. This means that th

Strona 48

52ATtiny15L1187E–AVR–06/02PORT B as General Digital I/O The lower five pins in Port B are equal when used as digital I/O pins.PBn, general I/O pin: Th

Strona 49

53ATtiny15L1187E–AVR–06/02• MISO/OC1A/AIN1 – PORT B, Bit 1In Serial Programming mode, this pin serves as the serial data output, MISO.In Normal mode,

Strona 50

54ATtiny15L1187E–AVR–06/02MemoryProgrammingProgram and DataMemory Lock BitsThe ATtiny15L MCU provides two Lock bits that can be left unprogrammed, “1”

Strona 51

55ATtiny15L1187E–AVR–06/02Calibration Byte The ATtiny15L has a one-byte calibration value for the internal RC Oscillator. This byteresides in the high

Strona 52

56ATtiny15L1187E–AVR–06/02High-voltage SerialProgramming AlgorithmTo program and verify the ATtiny15L in the High-voltage Serial Programming mode, the

Strona 53

57ATtiny15L1187E–AVR–06/02Table 25. High-voltage Serial Programming Instruction Set for ATtiny15L(1)InstructionInstruction FormatOperation RemarksInst

Strona 54

58ATtiny15L1187E–AVR–06/02Note: 1. a = address high bitsb = address low bitsi =dataino = data outx = don’tcare1= Lock Bit12= Lock Bit23 = CKSEL0 Fuse4

Strona 55

59ATtiny15L1187E–AVR–06/02High-voltage SerialProgrammingCharacteristicsFigure 32. High-voltage Serial Programming TimingLow-voltage SerialDownloadingB

Strona 56

6ATtiny15L1187E–AVR–06/02A flexible interrupt module has its control registers in the I/O space with an additionalGlobal Interrupt Enable bit in the S

Strona 57

60ATtiny15L1187E–AVR–06/02The device is clocked from the internal clock at the uncalibrated minimum frequency(0.8 - 1.6 MHz). The minimum low and high

Strona 58

61ATtiny15L1187E–AVR–06/02Data Polling When a byte is being programmed into the Flash or EEPROM, reading the addresslocation being programmed will giv

Strona 59

62ATtiny15L1187E–AVR–06/02Note: 1. a = address high bitsb = address low bitsH =0– low byte, 1 – high byteo = data outi =datainx = don’tcare1= Lock bit

Strona 60

63ATtiny15L1187E–AVR–06/02Low-voltage SerialProgrammingCharacteristicsFigure 35. Low-voltage Serial Programming TimingTable 28. Low-voltage Serial Pro

Strona 61

64ATtiny15L1187E–AVR–06/02Electrical CharacteristicsAbsolute Maximum RatingsOperating Temperature... -55°Cto+125°C*NOTI

Strona 62

65ATtiny15L1187E–AVR–06/02Note: 1. “Max” means the highest value where the pin is guaranteed to be read as low.2. “Min” means the lowest value where t

Strona 63

66ATtiny15L1187E–AVR–06/02TypicalCharacteristicsThe following charts show typical behavior. These data are characterized but not tested.All current co

Strona 64

67ATtiny15L1187E–AVR–06/02Figure 37. Idle Supply Current vs. VCCFigure 38. Calibrated Internal RC Oscillator Frequency vs. VCC00.511.522.532.5 3 3.5 4

Strona 65

68ATtiny15L1187E–AVR–06/02Figure 39. Bandgap Voltage vs. VCCFigure 40. Analog Comparator Offset Voltage vs. Common Mode VoltageNote: 1. Analog Compara

Strona 66

69ATtiny15L1187E–AVR–06/02Figure 41. Analog Comparator Offset Voltage vs. Common Mode VoltageFigure 42. Analog Comparator Input Leakage Current0246810

Strona 67

7ATtiny15L1187E–AVR–06/02The Program and DataAddressing ModesThe ATtiny15L AVR RISC Microcontroller supports powerful and efficient addressingmodes. T

Strona 68

70ATtiny15L1187E–AVR–06/02Figure 43. Watchdog Oscillator Frequency vs. VCCNote: 1. Sink and source capabilities of I/O ports are measured on one pin a

Strona 69

71ATtiny15L1187E–AVR–06/02Figure 45. Pull-up Resistor Current vs. Input VoltageFigure 46. I/O Pin Sink Current vs. Output Voltage0510152025300 0.5 1 1

Strona 70

72ATtiny15L1187E–AVR–06/02Figure 47. I/O Pin Source Current vs. Output VoltageFigure 48. I/O Pin Sink Current vs. Output Voltage024681012141618200 0.5

Strona 71

73ATtiny15L1187E–AVR–06/02Figure 49. I/O Pin Source Current vs. Output VoltageFigure 50. I/O Pin Input Threshold Voltage vs. VCC01234560 0.5 1 1.5 2 2

Strona 72

74ATtiny15L1187E–AVR–06/02Figure 51. I/O Pin Input Hysteresis vs. VCC00.020.040.060.080.10.120.140.160.182.7 4.0 5.0Input hysteresis (V)V ccI/O PIN IN

Strona 73

75ATtiny15L1187E–AVR–06/02ATtiny15L Register SummaryAddress Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page$3F SREG I T H S V N Z C page 11$

Strona 74

76ATtiny15L1187E–AVR–06/02ATtiny15L Instruction Set SummaryMnemonic Operands Description Operation Flags # ClocksARITHMETIC AND LOGIC INSTRUCTIONSADD

Strona 75

77ATtiny15L1187E–AVR–06/02CBI P, b Clear Bit in I/O Register I/O(P,b) ← 0 None 2LSL Rd Logical Shift Left Rd(n+1) ← Rd(n), Rd(0) ← 0 Z,C,N,V 1LSR Rd L

Strona 76

78ATtiny15L1187E–AVR–06/02Ordering InformationPower Supply Speed (MHz) Ordering Code Package Operation Range2.7 - 5.5V 1.6 ATtiny15L-1PCATtiny15L-1SC8

Strona 77

79ATtiny15L1187E–AVR–06/02Packaging Information8P310.16(0.400)9.017(0.355)PIN17.11(0.280)6.10(0.240).300 (7.62) REF5.33(0.210) MAX254(0.100) BSC 0.381

Strona 78

8ATtiny15L1187E–AVR–06/02Operands are contained in register r (Rr) and d (Rd). The result is stored in register d(Rd).I/O Direct Figure 7. I/O Direct

Strona 79

80ATtiny15L1187E–AVR–06/028S22325 Orchard ParkwaySan Jose, CA 95131TITLEDRAWING NO.RREV. 8S2, 8-lead, 0.209" Body, Plastic Small Outline Packag

Strona 80

1ATtiny15L1187E–AVR–06/02Table of ContentsFeatures... 1P

Strona 81

2ATtiny15L1187E–AVR–06/02I/O Port B ... 51Memory Programming

Strona 82

Printed on recycled paper.© Atmel Corporation 2002.Atmel Corporation makes no warranty for the use of its products, other than those expressly contain

Strona 83 - 1187E–AVR–06/02 0M

9ATtiny15L1187E–AVR–06/02Constant byte address is specified by the Z-register contents. The 15 MSBs select wordaddress (0 - 511), and LSB selects low

Komentarze do niniejszej Instrukcji

Brak uwag