Download: AVR242: 8-bit Microcontroller Multiplexing LED Drive anda4x4Keypad Multiplexing Features reduced to fifteen with a bit of ingenuity,

AVR242: 8-bit Microcontroller Multiplexing LED Drive anda4x4Keypad Multiplexing Features reduced to fifteen with a bit of ingenuity, allowing the smaller 20-pin AVR to be LED Drive and a • 16 Key Pushbutton Pad in4x4Matrix • 4 Digit Multiplexed LED Display with used. The circuit diagram is shown in Flashing Colon figure 1 and is complete apart from the4x4Keypad • Industrial Real Time Clock/timer oscillator components, which have been • Controls ON/OFF Times for two Loads omitted for clarity. • Tactile Feedback via Piezo-sounder The four keypad columns are connected • Flashing Display to Indica...
Author: Walway Shared: 8/19/19
Downloads: 112 Views: 2457

Content

AVR242: 8-bit Microcontroller Multiplexing LED Drive anda4x4Keypad Multiplexing Features reduced to fifteen with a bit of ingenuity,

allowing the smaller 20-pin AVR to be LED Drive and a • 16 Key Pushbutton Pad in4x4Matrix • 4 Digit Multiplexed LED Display with used. The circuit diagram is shown in Flashing Colon figure 1 and is complete apart from the4x4Keypad • Industrial Real Time Clock/timer oscillator components, which have been • Controls ON/OFF Times for two Loads omitted for clarity. • Tactile Feedback via Piezo-sounder The four keypad columns are connected • Flashing Display to Indicate Power Application to the low nibble of port B and the four Down Event keypad rows are connected to the high • Dual Function I/O Pins Note • nibble. The same eight bits also directlyMinimum External Components • Efficient Code drive the segment cathodes of the four • Complete Program Included for digit LED display, via current limit resis- AT90S1200 tors R13-20. The pins thus serve a dual • Suitable for any AVR MCU with 20 Pins function, acting as outputs when driving or more the LED display and I/O when scanning the keypad. This is accomplished by

Introduction using the programmable nature and

large current drive capabilities of the This application note describes a com- AVR ports to good effect. prehensive system providinga4x4key- The majority of the time port B sinks the pad as input into a real time clock/timer 9 mA of current, to directly drive the LED with two outputs. This system control segments . Each d igitis swi tched external loads, and a four digit mulit- sequentially in 5 ms time slots, to multi- plexed LED display. The application is plex the displays via the PNP transistors designed to show the versatility of the Q1-4. The common anodes of the LED AVR port configuration, and the effi- display digits are driven via PNP transis- ciency of the rich instruction set. The tors, since the maximum possible 72 mA application will run on any AVR with 20 (9mA - 8 segments) of current is outside pins or more, although due consideration the handling capabilities of the ports. will have to be given to stack initialization and table placement. The program has These can be any PNP type capable of been structured within the confines of driving 100 mA or so (e.g BC479). This the three level deep hardware stack at could be modified by paralleling up two the AT90S1200 and could be better port pins for each anode to share the structured in the other AVRs with soft- current, but then the number of I/O pins ware stack. required would necessitate the use of a larger MCU.

Theory of Operation Before the start of each display cycle,

the port configuration is changed to pro- The connection ofa4x4keypad, a vide four inputs with internal pull-ups piezo sounder, two LED loads and a four enabled, and four outputs in the low digit multiplexed display, would normally state to scan the keypad. If a key is require twenty-three I/O lines. This pressed the nibble configuration is trans- Rev. 1231A–12/98 appl ication shows how this can be, posed to calculate the key value with the key number Implementation stored in a variable. A short delay is allowed between each port change to allow the port to settle. This method is more The firmware comprises of two main areas, a background code efficient than the conventional “snake” method in this function, which is interrupt driven and provides the real- application. time accuracy, and the foreground processes. These con- sist of three sections, the reset routine, which sets up the The common anode drives are disabled during this time to ports, timer and the interrupts, the timesetting routine and avoid interference. The port configuration is then rein- the main housekeeping function. stated ready for the multiplexing routine. The main house- keeping function then uses this key variable to take the appropriate action. Foreground Process The real time clock is interrupt driven, using Timer 0 The foreground process is running for most of the time, clocked from the system clock divided by 256. The timer is only interrupted for 5.127 microseconds (21 cycles) every 5 preloaded with the number 176 and interrupts on overflow ms to update the real time clock variables. It consists of every five milliseconds, ensuring high accuracy if a good three sections, RESET, TIME SETTING and HOUSE- quality crystal is used. To be accurate a 4.096 MHz clock KEEPING. The flowchart is shown in Figure 1. crystal is employed. The program could be modified to use Figure 1. .Foreground process flow chart (Part 1) Contin- a 4 MHz crystal with minor modifications. ued on Figure 3. The interrupt service routine reloads the timer and incre- ments three variables: a counter variable (tock), a keypad Start debounce variable (bounce) and a counter to maintain the seconds count (second). This is used by the main house- keeping function to update the minutes and hours, which in Initialise ports turn are displayed by the display function. The housekeeping function checks the two loads for ON or Set up timer OFF times and controls the outputs on the high nibble of prescaler Reset port D accordingly. In this application the loads are simu- lated by red and green LEDs driven in current sink (active low) configuration. These could be replaced by relay driv- Load timer 0 ers or opto-coupled triacs to drive power loads. The keypad provides a means of setting up (SET) the real time and the ON/OFF times of each load and also allows Enable interrupts the loads to be turned off (CLEAR) at once. A Piezo- sounder, connected to the top bit of port D, provides an audible beep on keypress. Display flash FFFF The use of the port B pins requires some careful consider- ation. Since the pins are used for two functions, it is impor- tant that if a key is pressed, it does not short out the Time setting display. This is achieved by placing current limit resistors NSet? in series with each key. When used as inputs the internal pull-up resistors are employed saving external compo- nents. The choice of resistor value (R1-8) is such that the Y potential division is negligible. With the values chosen, and on a 5V supply, the logic levels are about 0.6V for logic “0” Set RTC and 4.95V for logic “1”. Resistors R21 and R22 are the tra- ditional current limit resistors for the LEDs and can be any suitable value for the supply rail. This note was tested A using 330 ohms on a 5V supply. The LEDs are driven in current sink mode (“0” = ON) and provide about 9 mA of forward current with the values specified.

Reset Section

On power up, or reset conditions, a reset routine is entered to initializes the system hardware. The ports are initialized 2 AVR242,

AVR242

with their starting directions and all pins set high to turn off A value of 176 provides 5 ms exactly , ensuring high RTC any loads. These are fixed as all outputs initially, requiring accuracy. 255 to be loaded into the data direction registers of both ports. The directions are modified on port B for a short time Time Setting by the keypad scanning function. The timer prescaler is set up to divide the clock by 256, givinga5ms interrupt period The LEDs are now made to flash EEEE to indicate that the when the timer is loaded with 176. The timer overflow inter- time is incorrect and needs resetting. This will continue rupt is then enabled followed by Global interrupts. until the SET key is pressed on the key pad. This calls the “setrtc” function which handles input from the keypad and The equation for the interrupt period is tied to the 4.096 display feedback. Once the time has been reset, the main MHz clock, providing an instruction cycle time of 0.2441 housekeeping function handles the updating and driving of microseconds. The number n to be loaded into the timer 0 the display from the main “second” variable, and scans the register TCNT0 is thus given by :- keypad for commands. (256 - n) * 256 * 0.2441 microseconds. Figure 2. Circuit Diagram for Keypad/Display Unit vcc vcc vcc vcc R9 R12 R11 R10 4K7 4K7 4K7 4K7 Q3 Q4 Q3 Q2 PNP PNP PNP PNP A4 A3 A2 A1 vcc C2 100uF Tant C1 100n AT1 vcc vcc AT90S1200 R13 R14 R15 R16 R17 R18 R19 R20 D1 330 330 330 330 330 330 330 330D2 1 GREEN RESET VCCRED 202 PD0 PB7 19 PD1 PB6 18 XTAL2 PB5 17 R21 R22 5 XTAL1 PB4 330 16330 6 PD2 PB3 15 PD3 PB2 14 PD4 PB1 13 PD5 PB0 12 10 R1123F8 GND PD6 11 2K7 R2 Row 4LS17456E2K7 Row 3R36789D2K7 Row 2R45A0BCPIEZO SOUNDER 2K7 Row 1R5 2K7 R6 2K7 R7 2K7 R8 2K7 dpgfedcbaCol1 Col2 Col3 Col4,

Housekeeping Figure 3. -Foreground process flow chart (part 2)

The main housekeeping function does the work of updating

A

the time variables derived from the background process and driving the LED display with the correct time. The key pad is also scanned to allow command inputs and the Toggle on/off times are checked for the loads. The flowchart is colon blink shown in Figure 3. The seconds, incremented by the interrupt service routine, are compared with 60. If 60 seconds has passed the N minute variable is incremented and the seconds reset to 60s? zero. The same procedure is adopted for the hours, with the minute variable compared to sixty and the hour variable Y incremented accordingly. The hour variable is then com- Increment pared with twenty-four to check for the start of a new day minutes and the hours and seconds all reset to zero. To save on the use of RAM storage, the minutes and hours have been confined to one byte each. The low nibble N houses the low digit and the high nibble the high digit. This 60m? means that it must be treated as BCD and the appropriate error trapping included to ensure correct counting. The Y minute or hour byte must therefore be split up into nibbles and checked for size on each check. Incrementhours If no change is encountered during any of the checks on minutes or hours the next section is bypassed and the time is displayed. The clock is a twenty-four hour type and con- sequently must cause a start of new day when the time is 24h? N incremented from 23:59. The display routine is a function called “display” which also includes the keyscan routine. This function is explained later. Y On return from the display function the key value is Start new day checked, followed by the on/off times for the loads and any appropriate action taken before the housekeeping loop is repeated. E.g. If load 1 on time equals the RTC then load 1 is turned on. Display time A “flag” variable is used to contain single bits to indicate various actions. This is used to pass control from one func- tion to another. For this application NINE flags were required, which is one more than that available in one byte. Y Time set? To save using another register just for one bit, the “T” flag Set RTC in the status register has been employed for the ninth bit. This is useful because it can be tested using specific N branch instructions (BRTC, BRTS) making programming easy, with the SBRS and SBRC instructions used for the Load Y main “flag” tests. The flags are active high and are allo- control Control loads cated as shown in table 1 below, along with their function: The time taken around the loop does not affect the accu- N racy of the RTC since it is interrupt driven, with the loop being interrupted four times during one pass of the loop. 4 AVR242,

AVR242

tion and calling it up four times. This can not be done with TABLE 1. Flag word usage the AT90S1200, because of the 3 level deep stack. “FLAG” bit number Function The first section disables the display anode drives and then 0 Load 1 active scans the keypad. This is done by changing the PORTB configuration to inputs on the row nibble and outputs on the 1 Load 2 active column nibble. The internal pull-ups are also enabled on 2 Load 1 ON the four inputs. All four columns bits are taken low and the row inputs read from PINB. This generates either a base 3 Load 1 OFF number, stored in “key” of 0, 4, 8, or 12 depending on the 4 Load 2 ON key row pressed, or the number 0x10 if no key is pressed. 5 Load 2 OFF The port configuration is then swapped over to make the row nibble outputs and the column nibble inputs, and the 6 Key press OK (debounced) row bits taken low. After a short settling time the column75ms tick pulse inputs are read from PINB and used to add a small offset of 0, 1, 2, or 3 to the base number depending on the key col- Status T flag Time Set encountered umn pressed. The end result is a number stored in “key” The central colon (dp) is flashed at half second intervals which is used as an index to look up the actual key value using the “blink” variable incremented by the background required in a table stored in EEPROM. The true key value interrupt process. This is used to toggle the “flash” variable is written back into “key” and used by the calling functions. which is used as a mask by the display function.The load This is necessary because the keys are not arranged in a check routine is actually more complex than the single flow- logical order. It also provides greater flexibility for the pro- chart box would suggest, testing the various control bits in grammer. The keypad layout and functions are shown in the “flag” word and taking action accordingly. Including this Figure 4. in the flowchart would have made it very difficult to follow. Figure 4. Keypad Layout and function If it picks up a “set load” command it calls up the “setrtc” function to load in a new on or off time for the load key selected. The same flashing method is employed here, 123Fonly now the display flashes “n” in the appropriate digit #1 #2 #3 Load 1 ON being entered and moves across from high to low as the time is entered. The user is thus sure which number is going where. 456EACLEAR command turns off both loads immediately can- #4 #5 #6 Load 1 OFF celling any previous on/off commands.These processes do not affect the RTC, which still maintains the correct time in the background. The RTC can also be modified, to update789Dthe time, at any stage by the same process. #7 #8 #9 Load 2 ON

A0BC Display Function SetRTC #0 Clear Load 2 OFF

The flowchart is shown in Figure 5. This function is called up by the flashing reset routine, the “setrtc” function and Key values greater than 9 are trapped and used to set the the housekeeping routine, and serves to scan the keypad corresponding bits in the “flag” word used by the calling and multiplex the display. If a larger AVR is to be employed functions. A key value of 0x10 indicates that no key has it would be worth making the digit drive segments a func- been pressed., Figure 5. Flowchart for keyscan part of “display” function Display A Clear Display Col1? Y Key = Key +0 Change port B I/O

N

Settle time Col 2? Y Key = Key +1

N

Row 1? Y Key = 0 Col 3? Y Key = Key +2

N N

Row 2? Y Key = 4 Col 4? Y Key = Key +3

N N Y

Row 3? Key = 8 Set "flag" N if needed Row 4? Y Key = 12 Y Key ? Beep

N N

Swap port Restore port I/O nibbles B configuration Settle delay B

A

If a key has been pressed a short “beep” is sent to the The digits are then multiplexed in turn in 5 ms time slots, piezo sounder connected to PORTD bit 6 for tactile feed- timed by the 5 ms flag set by the background process. This back to the user. gives about a 50 Hz display rate producing a bright, flicker free display (ignoring the short keyscan time). 6 AVR242,

AVR242

Each digit drive uses a look-up table stored in EEPROM for The function proceeds in four phases, starting from the the seven segment decoding, taking the index in via the most significant digit and working to the least significant “temp” register and using it to access the byte required to digit, displays a flashing “n” in each digit until a suitable light up that character. Several special characters are used value has been entered via the keypad. Values that are out to make keypad input more meaningful. For instance the of range are trapped and the input requested again until it letter’ E’ is defined for the flashing error display on power is in range. up, the letters “o”, “n” and “f” are defined for the load setting When all four digits have been input correctly the function ON/OFF inputs. If you are using a larger AVR for your exits with the hours in the variable “hiset” and the minutes application you may wish to transfer these tables to ROM in the varibable “loset”. These are redirected by the calling and access them by indexed addressing. function into the appropriate variables for use by the house- The colon blinking section then checks for a half second keeping function. event and changes the “flash” mask used in the previous Figure 7. display process, thus blinking the centre colon to indicate Flow chart for “setrtc” function correct clock function. SetRTC The function then returns to the calling function with the key value stored in “key”. Figure 6. .Flowchart for display part of “Display” function Set flashing display

B

Enter digit 4 Light Digit 1 for 5 ms OK? N Light Digit2Yfor 5ms Enter digit 3 Light Digit 3 for 5 ms OK? N including colon flash Y Enter digit 2 Light Digit 4 for 5 ms OK? N Return

Y

Enter digit 1

Setrtc Function

The flowchart is shown in Figure 7. This function is called up by all the routines which require keypad input to set up OK? N the display. This happens at power up/reset to enter the real time, on pressing the SET key to modify the real time, Y and on pressing any of the four load setting keys. It calls the display function to find the keypress and display the Clear digit flash appropriate digits. It uses a “bounce” counter, incremented every 5 ms by the background interrupt function, to provide a reasonable keypress action. Return,

Background Function (tick) Figure 8. Flowchart for “tick” Background Function

This function is triggered every 5 ms by timer 0 overflow and interrupts the foreground function at any point in the tick loop. The routine consequently preserves the status regis- ter on entry and restores it on exit as a matter of course, to avoid disturbing the foreground processes. The use of the Preserve status “temp” register is also avoided for the same reason. The function is very straightforward and merely increments Increment three counting registers on every entry, sets the 5 ms tick counters flag used by the display routine, reloads timer 0, and incre- ments the RTC second counter if necessary. The flowchart is shown in Figure 8. Set 5 ms flag

N

1s? Y Increment "seconds"

N

Reload timer 0 Restore status Return 8 AVR242,

AVR242 Resources

Table 2. CPU and Memory Usage Function Code Size Cycles Register Usage Interrupt Description Reset 17 words 17 cycles R16, R31 - Initiialization Timesetting 9 words 14 cycles R1, R2, R18, R19, R24, R25 - Initial setting of RTC Housekeeping 97 words 52 typical R1, R2, R16, R17, R18, R19, R20, - Main housekeeping loop to maintain R21, R24, R25, R28 real time display, respond to keypad and control loads. Display 158 words 150 typical R16, R17, R20, R21, R23, R24, - Keyscan and Display function R25, R26, R28 Setrtc 47 words 45 typical R1, R2, R16, R20, R22, R24, R25, - Function to handle keypad time and R26, R28 load setting input tick 15 words 21 cycles R0, R31 TIMER0 Background interrupt service routine to provide real time 5 ms and1s“tick” TOTAL 343 words - R0, R1, R2, R16, R17, R18, R19, TIMER0 R20, R21, R22, R23, R24, R25, R26, R28, R31 Table 3. Peripheral Usage Perpheral Description Interrupts Timer05ms tick counter Timer 0 overflow with prescalar set to divide by 256 16 byte EEPROM Key to value mapping Seven segment decoding - 8 I/O pins PORTB4x4keypad connections and LED segment drive(dual - function) 3 I/O pins PORT D Load 1 and 2 and piezo-sounder - 4 I/O pins PORT D Anoder drive for four digit LED display -, ;**** APPLICATIONNOTEAVR242 ************************ ;* ;* Title: Multiplexing LED drive and 4x4 keypad sampling ;* Version: 1.0 ;* Last Updated: 98.07.24 ;* Target: All AVR Devices ;* ;* Support E-mail:email is hidden ;* ;* DESCRIPTION ;* This Application note covers a program to provide a 24 hr Industrial ;* timer or real-time clock using I/O pins for dual functions. ;* With input viaa4x4matrix keypad, output to a multiplexed ;* four digit LED display and two ON/OFF outputs to drive loads via additional ;* interface circuitry. LED loads are driven in this example but it could drive ;* any load with the addition of suitable components. Tactile feedback is provided ;* on every key press by a piezo sounder which beeps when a key is pressed. ;* Included is a main program that allows clock setting via the keypad ;* and one ON/OFF time setting per 24 hours for each load, functions for the ;* real time clock, key scanning, and adjustment routines. The example runs on ;* the AT90S1200 to demonstrate how limited I/O can be overcome, but can ;* be any AVR with suitable changes in vectors, EEPROM and stack pointer. ;* The timing assumes a 4.096 MHz crystal is employed (a 4 MHz crystal produces ;* an error of -0.16% if 178 instead of 176 used in the timer load sequence, but this ;* could be adjusted in software at regular intervals). Look up tables are ;* used in EEPROM to decode the display data, with additional characters provided ;* for time and ON/OFF setting displays and a key pad conversion table. ;* If the EEPROM is needed for your application the tables could be moved ;* to ROM in the larger AVR devices. ;*************************************************************************** ;***** Registers used by all programs ;******Global variables used by routines .def loset =r1 ;storage for timeset minutes .def hiset =r2 ;storage for timeset hours .def ld1minon =r3 ;storage for load on and off times .def ld1hron =r4 ;set from keypad entry .def ld1minoff =r5 ;and tested in the housekeeping function .def ld1hroff =r6 ;and stores on or off times for the loads .def ld2minon =r7 .def ld2hron =r8 .def ld2minoff =r9 .def ld2hroff =r10 .def temp =r16 ;general scratch space .def second =r17 ;storage for RTC second count .def minute =r18 ;storage for RTC minute count .def hour =r19 ;storage for RTC hour count .def mask =r20 ;flash mask for digits flashing 10 AVR242,

AVR242

.def blink =r21 ;colon blink rate counter .def bounce =r22 ;keypad debounce counter .def flash =r23 ;flash delay counter .def lobyte =r24 ;storage for display function minutes digits .def hibyte =r25 ;storage for display function hours digits .def key =r26 ;key number from scan ;***'key' values returned by 'keyscan'*************************** ;VALUE012345678910 11 12 13 14 15 16 ;KEY123F56E789DA0BCNONE ;FUNC123LD1ON456LD1OFF789LD2ON SET 0 CLEAR LD2OFF .deftock=r27 ;5 ms pulse .defflags=r28 ;flag byte for keypad command keys ; 76543210; 5ms keyok ld2off ld2on ld1off ld1on ld2 ld1 ; tick 0 = off, 1 = on .equ ms5 =7 ;ticks at 5 ms intervals for display time .equ keyok =6 ;sets when key is debounced, must be cleared again .equ ld2off =5 ;set by load ON/OFF key press and flags .equ ld2on =4 ;up the need for action .equ ld1off =3 ;in the housekeeping routine .equ ld1on =2 .equ ld2 =1 ;when set tells the housekeeping routine to .equ ld1 =0 ;check load on/off times. ;***the T flag in the status register is used as a SET flag for time set .equ clear =0 ;RTC modification demand flag ;Port B pins .equ col1 =0 ;LED a segment/keypad col 1 .equ col2 =1 ;LED b segment/keypad col 2 .equ col3 =2 ;LED c segment/keypad col 3 .equ col4 =3 ;LED d segment/keypad col 4 .equ row1 =4 ;LED e segment/keypad row 1 .equ row2 =5 ;LED f segment/keypad row 2 .equ row3 =6 ;LED g segment/keypad row 3 .equ row4 =7 ;LED decimal point/keypad row 4 ;Port D pins .equ A1 =0 ;common anode drives (active low) .equ A2 =1 ; .equ A3 =2 ; .equ A4 =3 ; .equ LOAD1 =4 ;Load 1 output (active low) .equ LOAD2 =5 ;Load 2 output (active low) .equ PZ =6 ;Piezo sounder output (active low) .include "1200def.inc", ;***** Registers used by timer overflow interrupt service routine .def timer =r31 ;scratch space for timer loading .def status =r0 ;low register to preserve status register ;*****Look up table for LED display decoding ********************** .eseg ;EEPROM segment .org 0 table1: .db 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90 ;digit0123456789.db 0x86,0x8E,0xA3,0xAB,0XFF,0XFF ;digitEfonBLANK special characters ;****Look up table for key value conversion into useful numbers**** ;key123F456E789DA0BCtable2: .db 1, 2, 3,15, 4, 5, 6,14, 7, 8, 9, 13, 10, 0, 11, 12 ;value012345678910 11 12 13 14 15 ;****Source code*************************************************** .cseg ;CODE segment .org 0 rjmp reset ;Reset handler nop ;unused ext. interrupt rjmp tick ;timer counter overflow (5 ms) nop ;unused analogue interrupt ;*** Reset handler ************************************************** ;*** to provide initial port, timer and interrupt setting up reset: ser temp ; out DDRB,temp ;initialize port B as all Outputs out DDRD,temp ;initialize port D as all Outputs out PORTB,temp ;key columns all high/LEDs off out PORTD,temp ;turn off LEDs and loads off ldi temp,0x04 ;timer prescalar /256 out TCCR0,temp ldi timer,176 ;load timer for 5 ms out TCNT0,timer ;(256 - n)*256*0.2441 us ldi temp,0x02 ;enable timer interrupts out TIMSK,temp clr flags ;clear control flags clr tock ;clear 5 ms tick clr bounce ;clear key bounce counter clr flash 12 AVR242,

AVR242

clr blink sei ;enable global interrupts ;****Flash EEEE on LEDS as test and power down warning************** ;****repeats until SET key is pressed on keypad timesetting: ldi hibyte,0xaa ;show "EEEE" on LED ldi lobyte,0xaa ;display and ser mask ;set flashing display notyet: rcall display ;display until time set brtc notyet ;repeat until SET key pressed rcall setrtc ;and reset time mov hour,hiset ;and reload hours mov minute,loset ;and minutes clt ;clear T flag ;*****Main clock house keeping loop***************************** do: clr mask ;do housekeeping cpi blink,100 ;is half second up brne nohalf clr blink com flash ;invert flash nohalf: cpi second,60 ;is one minute up? brne nochange ;no clr second ;yes clear seconds and inc minute ;add one to minutes mov temp,minute andi temp,0x0f ;mask high minute cpi temp,10 ;is it ten minutes? brne nochange ;no andi minute,0xf0 ;clear low minutes ldi temp,0x10 add minute,temp ;increment high minutes cpi minute,0x60 ;is it 60 minutes? brne nochange ;no clr minute ;yes, clear minutes and inc hour ;add one to hours mov temp,hour andi temp,0x0f ;mask high hour cpi temp,10 ;is 10 hours up? brne nochange ;no andi hour,0xf0 ;yes, increment ldi temp,0x10 add hour,temp ;high hours, nochange: cpi hour,0x24 ;is it 24 hours? brne sameday ;no, clr hour ;yes, clear time variables clr minute ;to start new day clr second sameday: ;update times mov lobyte,minute mov hibyte,hour rcall display ;show time for 20 ms brtc case1 ;if not SET rcall setrtc ;and reset time mov hour,hiset ;and reload hours mov minute,loset ;and minutes clt ;else, clear T flag case1:sbrc flags,ld1 ;is load 1 active? rjmp chkload1 ;yes, check load 1 case2:sbrc flags,ld2 ;is load 2 active rjmp chkload2 ;yes, check load 2 case3: sbrc flags,ld1on ;is load 1 on time reset rjmp setld1on ;yes reset on time case4: sbrc flags,ld1off ;is load 1 off time reset rjmp setld1off ;yes reset off time case5: sbrc flags,ld2on ;is load 2 on time reset rjmp setld2on ;yes reset on time case6: sbrc flags,ld2off ;is load 2 on time reset rjmp setld2off ;yes reset on time case7: rjmp do ;repeat housekeeping loop ;****case routines to service load times and key presses******** chkload1: cp hour,ld1hroff ;is load 1 off time reached? brne onload1 cp minute,ld1minoff brne onload1 sbi PORTD,LOAD1 ;yes, turn load 1 off onload1: cp hour,ld1hron ;is load 1 on time reached? brne case2 cp minute,ld1minon brne case2 cbi PORTD,LOAD1 ;yes,turn load 1 on rjmp case2 ;repeat with load on 14 AVR242,

AVR242

chkload2: cp hour,ld2hroff ;is load 2 off time reached? brne onload2 cp minute,ld2minoff brne onload2 sbi PORTD,LOAD2 ;yes, turn load 2 off onload2: cp hour,ld2hron ;is load 2 on time reached? brne case3 cp minute,ld2minon brne case3 cbi PORTD,LOAD2 ;yes,turn load 2 on rjmp case3 ;repeat with load on setld1on: sbr flags,0x01 ;make load 1 active rcall setrtc ;pickup new on time mov ld1hron,hiset ;and store mov ld1minon,loset cbr flags,0x04 ;clear ld1on flag rjmp case4 setld1off: rcall setrtc ;pickup new off time mov ld1hroff,hiset ;and store mov ld1minoff,loset cbr flags,0x08 ;clear ld1off flag rjmp case5 setld2on: sbr flags,0x02 ;make load 2 active rcall setrtc ;pickup new on time mov ld2hron,hiset ;and store mov ld2minon,loset cbr flags,0x10 ;clear ld2on flag rjmp case6 setld2off: rcall setrtc ;pickup new on time mov ld2hroff,hiset ;and store mov ld2minoff,loset cbr flags,0x20 ;clear ld2off flag rjmp case7 ;****Multiplexing routine to display time and scan keypad every***** ;****second pass,used by all routines taking digits from hibyte ;****and lobyte locations with each digit on for 5 ms display: ser temp ;clear display out PORTB,temp, ;****Keypad scanning routine to update key flags******************* keyscan: cbr flags,0x40 ;clear keyok flag ldi key,0x10 ;set no key pressed value ser temp ;set keypad port high prior to out PORTB,temp ;reinitializing the port in temp,PORTD ;turn off LEDs and leave loads ori temp,0x0f ;untouched prior to out PORTD,temp ;key scan ldi temp,0x0f ;set columns output and out DDRB,temp ;rows input with pull-ups ldi temp,0xf0 ;enabled and all columns out PORTB,temp ;low ready for scan ldi temp,20 ;short settling time tagain1: dec temp brne tagain1 sbis PINB,ROW1 ;find row of keypress ldi key,0 ;and set ROW pointer sbis PINB,ROW2 ldi key,4 sbis PINB,ROW3 ldi key,8 sbis PINB,ROW4 ldi key,12 ldi temp,0xF0 ;change port B I/O to out DDRB,temp ;find column press ldi temp,0x0F ;enable pull ups and out PORTB,temp ;write 0s to rows ldi temp,20 ;short settling time tagain2: dec temp brne tagain2 ;allow time for port to settle clr temp sbis PINB,COL1 ;find column of keypress ldi temp,0 ;and set COL pointer sbis PINB,COL2 ldi temp,1 sbis PINB,COL3 ldi temp,2 sbis PINB,COL4 ldi temp,3 add key,temp ;merge ROW and COL for pointer cpi key,0x10 ;if no key pressed breq nokey ;escape routine, else ldi temp,0x10 add key,temp ;change to table 2 out EEAR,key ;send address to EEPROM (0 - 15) sbi EECR,EERE ;strobe EEPROM 16 AVR242,

AVR242

in key,EEDR ;read decoded number for true key convert: cpi key,10 ;is it SET key ? brne notset ;no check next key set ;yes set T flag in status register notset: cpi key,11 ;is key CLEAR? brne notclear ;no, check next key sbi PORTD,LOAD1 ;yes, shut down all loads sbi PORTD,LOAD2 cbr flags,0x03 ;deactivate both loads notclear: cpi key,15 ;is key LD1ON? brne notld1on ;no, check next key sbr flags,0x04 ;yes, set LD1ON flag notld1on: cpi key,14 ;is key LD1OFF? brne notld1off ;no, check next key sbr flags,0x08 ;yes, set LD1OFF flag notld1off: cpi key,13 ;is key LD2ON? brne notld2on ;no, check next key sbr flags,0x10 ;yes, set LD2ON flag notld2on: cpi key,12 ;is key LD2OFF? brne notld2off ;no, check next key sbr flags,0x20 ;yes, set LD2OFF flag notld2off: ;***Tactile feedback note generation routine***************** ;***providesa4kHz TONE to the piezo sounder for 5 ms***** tactile: cbr flags,0x80 cbi PORTD,PZ ;turn on piezo ldi temp,125 ;for a short time t1again: dec temp brne t1again sbi PORTD,PZ ;turn on piezo ldi temp,125 ;for a short time t2again: dec temp brne t2again sbrs flags,ms5 ;repeat for 5ms rjmp tactile notok: cpi bounce,40 brlo nokey sbr flags,0x40 ;set bounce flag, nokey: ser temp out DDRB,temp ;reinitialize port B as all Outputs out PORTB,temp ;and clear LEDs ;***Display routine to multiplex all four LED digits**************** cbi PORTD,A1 ;turn digit 1 on mov temp,lobyte ;find low minute digit1: cbr flags,0x80 ;clear 5 ms tick flag andi temp,0x0f ;mask high nibble of digit out EEAR,temp ;send address to EEPROM (0 - 15) sbi EECR,EERE ;strobe EEPROM in temp,EEDR ;read decoded number sbrs flash,clear ;flash every 1/2 second or temp,mask ;flash digit if needed out PORTB,temp ;write to LED for 5 ms led1: sbrs flags,ms5 ;5 ms finished? rjmp led1 ;no, check again sbi PORTD,A1 ;turn digit 1 off ser temp ;clear display out PORTB,temp cbi PORTD,A2; mov temp,lobyte ;find high minute swap temp digit2: cbr flags,0x80 ;clear 5 ms tick flag andi temp,0x0f ;mask high nibble of digit out EEAR,temp ;send address to EEPROM (0 - 15) sbi EECR,EERE ;strobe EEPROM in temp,EEDR ;read decoded number sbrs flash,clear ;flash every 1/2 second or temp,mask ;flash digit if needed out PORTB,temp ;write to LED for 5 ms led2: sbrs flags,ms5 ;5 ms finished? rjmp led2 ;no, check again sbi PORTD,A2 ; ser temp ;clear display out PORTB,temp cbi PORTD,A3 ; mov temp,hibyte digit3: cbr flags,0x80 ;clear 5 ms tick flag andi temp,0x0f ;mask high nibble of digit out EEAR,temp ;send address to EEPROM (0 - 15) sbi EECR,EERE ;strobe EEPROM in temp,EEDR ;read decoded number 18 AVR242,

AVR242

sbrs second,clear ;flash colon andi temp,0x7f sbrs flash,clear ;flash every 1/2 second or temp,mask ;flash digit if needed out PORTB,temp ;write to LED for 5 ms led3: sbrs flags,ms5 ;5 ms finished? rjmp led3 ;no, check again sbi PORTD,A3 ser temp ;clear display out PORTB,temp cbi PORTD,A4; mov temp,hibyte swap temp andi temp,0x0f ;is hi hour zero? brne digit4 ldi temp,0xff ;yes,blank hi hour digit4: cbr flags,0x80 ;clear 5 ms tick flag andi temp,0x0f ;mask high nibble of digit out EEAR,temp ;send address to EEPROM (0 - 15) sbi EECR,EERE ;strobe EEPROM in temp,EEDR ;read decoded number sbrs flash,clear ;flash every 1/2 second or temp,mask ;flash digit if needed out PORTB,temp ;write to LED for 5 ms led4: sbrs flags,ms5 ;5 ms finished? rjmp led4 ;no, check again sbi PORTD,A4 ser temp ;clear display out PORTB,temp tst mask ;is flash complete? breq outled ;yes, exit cpi blink,50 ;is blink time done? brlo outled ;no, exit clr blink ;yes, clear blink rate counter com flash ;and invert flash byte outled: ret ;****Function to Set RTC/on-off hours and minutes from keypad ;****returns with minutes in 'loset' and hours in'hiset' setrtc: ser mask ;set flashing display ldi hibyte,0xdf ;place 'n' in hi hour ser lobyte ;and blank in lo hr & minutes hihrus: clr bounce, bounce1: rcall display ;display and check keypad sbrs flags,keyok rjmp bounce1 cbr flags,0x40 ;clear keyok flag cpi key,0x03 ;is high hour > 2 brsh hihrus ;yes, read key again hihrok: ;no, valid entry swap key ;move hihour to hi nibble mov hiset,key ;and store in hours ldi hibyte,0x0d ;place 'n' in lo hour add hibyte,hiset ;merge hihour and 'n' lohrus: clr bounce bounce2: rcall display ;display and check keypad sbrs flags,keyok ;is key stable? rjmp bounce2 ;no try again cbr flags,0x40 ;yes, clear keyok flag mov temp,hibyte ;check that total hours andi temp,0xf0 ;are not > 24 add temp,key cpi temp,0x24 ;is hour>24? brsh lohrus ;yes, read key again add hiset,key ;no, merge hi and lo hours lohrok: mov hibyte,hiset ;display hours as set ldi lobyte,0xdf ;place 'n' in hi minutes himinus: clr bounce bounce3: rcall display ;display and check keypad sbrs flags,keyok rjmp bounce3 cbr flags,0x40 ;clear keyok flag cpi key,6 ;is hi minutes >5 brsh himinus ;no, read key again lominok: swap key ;move himin to hi nibble mov loset,key ;and store in minutes ldi lobyte,0x0d ;place 'n' in lo minutes add lobyte,loset ;merge with hi minute lominus: clr bounce bounce4: rcall display ;display and check keypad sbrs flags,keyok rjmp bounce4 cbr flags,0x40 ;clear keyok flag cpi key,10 ;is key >9 brsh lominus ;no, read key again 20 AVR242,

AVR242

add loset,key ;yes, merge hi and lo minutes clr mask ;clear digits flash ret ;and return with time set ;****Timer Overflow Interrupt service routine****************************** ;****Updates 5 ms, flash and debounce counter to provide RTC time reference tick: in status,SREG ;preserve status register inc tock ;add one to 5 ms 'tock' counter inc blink ;and blink rate counter inc bounce ;and bounce rate delay sbr flags,0x80 ;set 5 ms flag for display time cpi tock,200 ;is one second up? breq onesec ;yes, add one to seconds nop ;balance interrupt time rjmp nosecond ;no, escape onesec: inc second ;add one to seconds clr tock ;clear 5 ms counter nosecond: ldi timer,176 ;reload timer out TCNT0,timer out SREG,status ;restore status register reti ;return to main,

Atmel Headquarters Atmel Operations Corporate Headquarters Atmel Colorado Springs

2325 Orchard Parkway 1150 E. Cheyenne Mtn. Blvd. San Jose, CA 95131 Colorado Springs, CO 80906 TEL (408) 441-0311 TEL (719) 576-3300 FAX (408) 487-2600 FAX (719) 540-1759

Europe Atmel Rousset

Atmel U.K., Ltd. Zone Industrielle Coliseum Business Centre 13106 Rousset Cedex, France Riverside Way TEL (33) 4 42 53 60 00 Camberley, Surrey GU15 3YL FAX (33) 4 42 53 60 01 England TEL (44) 1276-686677 FAX (44) 1276-686697

Asia

Atmel Asia, Ltd. Room 1219 Chinachem Golden Plaza 77 Mody Road Tsimshatsui East Kowloon, Hong Kong TEL (852) 27219778 FAX (852) 27221369

Japan

Atmel Japan K.K. Tonetsu Shinkawa Bldg., 9F 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan TEL (81) 3-3523-3551 FAX (81) 3-3523-7581

Fax-on-Demand

North America: 1-(800) 292-8635 International: 1-(408) 441-0732 e-mail email is hidden

Web Site

http://www.atmel.com

BBS

1-(408) 436-4309 © Atmel Corporation 1998. Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard war- ranty which is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual prop- er ty of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use as critical components in life support devices or systems. Marks bearing ® and/or ™ are registered trademarks and trademarks of Atmel Corporation. Printed on recycled paper. Terms and product names in this document may be trademarks of others. 1231A–12/98/xM]
15

Similar documents

8-bit Microcontroller Application Note AVR180: External Brown-out Protection
8-bit Microcontroller Application Note Rev. 1051B–AVR–05/02 AVR180: External Brown-out Protection Features • Low-voltage Detector • Prevent Register and EEPROM Corruption • Two Discrete Solutions • Integrated IC Solution • Extreme Low-cost Solution • Extreme Low-power Solution • Formulas for Compone
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 1259D–AVR–04/05 AVR134: Real Time Clock (RTC) using the Asynchronous Timer Features • Real Time Clock with Very Low Power Consumption (4 µA @ 3.3V) • Very Low Cost Solution • Adjustable Prescaler to Adjust Precision • Counts Time, Date, Month, and Year wit
  Wiring Diagram
Wiring Diagram Samsung Electronics 6-1
8-bit Microcntroller Application Note
8-bit Microcntroller Application Note Rev. 2532A–AVR–01/03 AVR243: Matrix Keyboard Decoder Features • 64-key Push-button Keyboard in8x8Matrix • No External Components Required • Wakes Up from Sleep Mode on Keypress • Easily Implemented into Other Applications • Low Power Consumption • Software Conta
  Alignment and Adjustments
Alignment and Adjustments 1. Tuner FM THD Adjustment FMOutput Antenna GND SETSSG FREQ. 98 MHz Terminal Oscilloscope Adjustment FM S.S.G Input point FM DETECTOR COIL Speaker (FM DET) Terminal output Input Output 60 dB Distortion Meter Minumum Distortion (0.4% below) (Figure 1-1) Figure1-1 IF CENTER
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 2540A–AVR–07/03 AVR104: Buffered Interrupt Controlled EEPROM Writes Features • Flexible Multi-byte EEPROM Buffer • Power Efficient EEPROM Access • Access Control on Buffers • EEPROM Buffer Rewrite Introduction Many applications use the built-in EEPROM of t
  Schematic Diagram - This Document can not be used without Samsung’s authorization -
Schematic Diagram - This Document can not be used without Samsung’s authorization - 7-1 MAIN 7-1 Samsung Electronics 7-2 FRONT - This Document can not be used without Samsung’s authorization - Samsung Electronics 7-2 7-3 DSP - This Document can not be used without Samsung’s authorization - 7-3 Sam
  TroubleShooting
TroubleShooting 9-1 Main 9-1 Samsung Electronics Samsung Electronics 9-2 9-3 Samsung Electronics Samsung Electronics 9-4 9-2 DVD Servo parts 9-5 Samsung Electronics Samsung Electronics 9-6 9-7 Samsung Electronics Samsung Electronics 9-8 9-9 Samsung Electronics Samsung Electronics 9-10 9-11 Samsung
AVR054: Run-time calibration of the internal RC oscillator
AVR054: Run-time calibration of the internal RC oscillator Features • Calibration of internal RC oscillator via UART • LIN 2.0 compatible synchronization/calibration to within +/-2% of target frequency • Alternate run-time synchronization/calibration to within +/-1% of target frequency • Support for
SERVICE Manual
DVD RECEIVER AMP HT-DB120 SERVICE Manual DVD RECEIVER AMP SYSTEM CONTENTS 1. Alignment and Adjustments 2. Exploded Views and Parts List 3. Electrical Parts List 4. Block Diagrams 5. PCB Diagrams 6. Wiring Diagram 7. Schematic Diagrams 8. IC block Diagrams 9.Troubleshooting - Confidential - ELECTRONI
8-bit Microcontroller Application Note AVR131: Using the AVR’s High-speed PWM
8-bit Microcontroller Application Note Rev. 2542A–AVR–09/03 AVR131: Using the AVR’s High-speed PWM Features • Analog Waveform Generation using PWM • High-speed Prescalable PWM Clock Introduction This application note is an introduction to the use of the high-speed Pulse Width Mod- ulator (PWM) avail
8-bit RISC Microcontroller Application Note AVR042: AVR® Hardware Design Considerations
8-bit RISC Microcontroller Application Note Rev. 2521B–AVR–01/04 AVR042: AVR® Hardware Design Considerations Features • Providing Robust Supply Voltage, Digital and Analog • Connecting the RESET Line • SPI Interface for In-System Programming • Using External Crystal or Ceramic Resonator Oscillators
8-bit Microcontroller Application Note AVR240: 4x4Keypad – Wake-up on Keypress Features Introduction
8-bit Microcontroller Application Note AVR240: 4x4Keypad – Wake-up on Keypress Features • 16 Key Pushbutton Pad in4x4Matrix • Very Low Power Consumption • AVR in Sleep Mode and Wakes Up on Keypress • Minimum External Components • ESD Protection Included if Necessary • Efficient Code • Complete Progr
Microcontrollers for Fluorescent and High Intensity Discharge Lamp Ballasts SMARTER, MORE FLEXIBLE LIGHTING SOLUTIONS
LIGHTINGMICROCONTROLLERSMicrocontrollers for Fluorescent and High Intensity Discharge Lamp Ballasts SMARTER, MORE FLEXIBLE LIGHTING SOLUTIONS Developed together with the industry leading lamp ballast manufac- turers, Atmel® microcontrollers are optimized for Linear and Dimmable Fluorescent tubes, as
AVR121: Enhancing ADC resolution by oversampling
AVR121: Enhancing ADC resolution by oversampling Features • Increasing the resolution by oversampling • Averaging and decimation • Noise reduction by averaging samples 1 Introduction Atmel’s AVR controller offers an Analog to Digital Converter with 10-bit resolution. In most cases 10-bit resolution
  IC Block Diagrams 8-1 Main
IC Block Diagrams 8-1 Main 8-1-1. FAN8082D 8-1 Samsung Electronics 8-1-2. LC87F66C8A Samsung Electronics 8-2 8-3 Samsung Electronics Samsung Electronics 8-4 8-5 Samsung Electronics 8-1-3. M62446AFP Samsung Electronics 8-6 8-7 Samsung Electronics 8-1-4. M66010FP 8-1-5. SI-8050SE 8-1-6. SI-8090JFE S
AVR053: Calibration of the internal RC oscillator Features Introduction
AVR053: Calibration of the internal RC oscillator Features • Calibration using STK500, AVRISP, JTAGICE or JTAGICE mkII • Calibration using 3rd party programmers • Adjustable RC frequency with +/-1% accuracy • Tune RC oscillator at any operating voltage and temperature • Tune RC oscillator to any fre
8-bit Microcontroller Application Note AVR230: DES Bootloader Features
8-bit Microcontroller Application Note Rev. 2541D–AVR–04/05 AVR230: DES Bootloader Features • Fits All AVR Microcontrollers with Bootloader Capabilities • Enables Secure Transfer of Compiled Software or Sensitive Data to Any AVR with Bootloader Capabilities • Includes Easy To Use, Configurable Examp
AVR106: C functions for reading and writing to Flash memory
AVR106: C functions for reading and writing to Flash memory Features • C functions for accessing Flash memory - Byte read - Page read - Byte write - Page write • Optional recovery on power failure • Functions can be used with any device having Self programming Program memory • Example project for us
8-bit Microcontroller Application Note AVR201: Using the AVR® Hardware Multiplier
8-bit Microcontroller Application Note Rev. 1631C–AVR–06/02 AVR201: Using the AVR® Hardware Multiplier Features • 8- and 16-bit Implementations • Signed and Unsigned Routines • Fractional Signed and Unsigned Multiply • Executable Example Programs Introduction The megaAVR is a series of new devices i
  Printed Circuit Board Diagram
Printed Circuit Board Diagram 5-1 MAIN 5-1 Samsung Electronics 5-2 FRONT Samsung Electronics 5-2 5-3 DSP 5-3 Samsung Electronics 5-4 JACK * RCA JACK * SCART JACK Samsung Electronics 5-4 5-5 DVD PACK * TOP VIEW * BOTTOM VIEW 5-5 Samsung Electronics
8-bit Microcontroller Application Note AVR105: Power Efficient High Endurance Parameter Storage in Flash Memory
8-bit Microcontroller Application Note Rev. 2546A–AVR–09/03 AVR105: Power Efficient High Endurance Parameter Storage in Flash Memory Features • Fast Storage of Parameters • High Endurance Flash Storage – 350K Write Cycles • Power Efficient Parameter Storage • Arbitrary Size of Parameters • Semi-redu
8-bit RISC Microcontoller Application Note AVR130: Setup and Use the AVR® Timers Features
8-bit RISC Microcontoller Application Note Rev. 2505A–AVR–02/02 AVR130: Setup and Use the AVR® Timers Features • Description of Timer/Counter Events • Timer/Counter Event Notification • Clock Options • Example Code for Timer0 – Overflow Interrupt • Example Code for Timer1 – Input Capture Interrupt •
8-bit RISC Microcontroller Application Note AVR151: Setup And Use of The SPI Features Introduction
8-bit RISC Microcontroller Application Note Rev. 2585A–AVR–11/04 AVR151: Setup And Use of The SPI Features • SPI Pin Functionality • Multi Slave Systems • SPI Timing • SPI Transmission Conflicts • Emulating the SPI • Code examples for Polled operation • Code examples for Interrupt Controlled operati
AVR241: Direct driving of LCD display using general IO
AVR241: Direct driving of LCD display using general IO Features • Software driver for displays with one common line • Suitable for parts without on-chip hardware for LCD driving • Control up to 15 segments using 16 IO lines • Fully interrupt driven operation Introduction As a low power alternative t
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 0938B–AVR–01/03 AVR204: BCD Arithmetics Features • Conversion 16 Bits ↔ 5 Digits, 8 Bits ↔ 2 Digits • 2-digit Addition and Subtraction • Superb Speed and Code Density • Runable Example Program Introduction This application note lists routines for BCD arith
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 2530B–AVR–01/04 AVR065: LCD Driver for the STK502 and AVR Butterfly Features • Software Driver for Alphanumeric Characters • Liquid Crystal Display (LCD) Contrast Control • Interrupt Controlled Updating • Conversion of ASCII to LCD Segment Control Codes (S
8-bit Instruction Set Instruction Set Nomenclature
8-bit Instruction Set Rev. 0856D–AVR–08/02 Instruction Set Nomenclature Status Register (SREG) SREG: Status Register C: Carry Flag Z: Zero Flag N: Negative Flag V: Two’s complement overflow indicator S: N ⊕ V, For signed tests H: Half Carry Flag T: Transfer bit used by BLD and BST instructions I: Gl
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 0933B–AVR–05/02 AVR102: Block Copy Routines Features • Program Memory (Flash) to SRAM Copy Routine • SRAM to SRAM Copy Routine • Extremely Code Efficient Routines Flash → SRAM: 6 Words, SRAM → SRAM: 5 Words • Runable Test/Example Program Introduction This
Novice’s Guide to AVR Development intended for
Novice’s Guide to AVR Development Preparing your PC for AVR Development Basic AVR Knowledge An Introduction Let's make an easy start, and download the files that we will need later on. The AVR Microcontroller family is a modern architecture, with all the bells andFirst you should download the files