84 Pages

GettingStarted

Course: CS 466, Fall 2009
School: Washington
Rating:
 
 
 
 
 

Word Count: 12072

Document Preview

7KH.UHDWLRQRIPDNHILOHV $SSOL.DWLRQ1RWHV 7KLVSDJHDQGDOOOLQNHGGR.XPHQWVKDYHEHHQZULWWHQE\/HLWQHU+DUDOG 0DNHILOHVSURYLGHWKHSRVVLELOLW\RIWUDQVODWLQJRZQSURJUDPVHIIL.LHQWO\ +HUH,GHV.ULEHKRZ\RXKDYHWRDOWHUWKHPDNHILOHVIRU\RXURZQSURJUDPV PDNHGR.SGI 7KH.RPELQDWLRQRI&DQGDVVHPEOHULQVWUX.WLRQV 7KLVGR.XPHQWGHV.ULEHVWKHSRVVLELOLW\RILQVHUWLQJWKHDVVHPEOHULQVWUX.WLRQVLQ\RXU&SURJUDPVGLUH.WO\ RUWKURXJKPD.URV DVPGR.SGI...

Register Now

Unformatted Document Excerpt

Coursehero >> Washington >> Washington >> CS 466

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
7KH.UHDWLRQRIPDNHILOHV $SSOL.DWLRQ1RWHV 7KLVSDJHDQGDOOOLQNHGGR.XPHQWVKDYHEHHQZULWWHQE\/HLWQHU+DUDOG 0DNHILOHVSURYLGHWKHSRVVLELOLW\RIWUDQVODWLQJRZQSURJUDPVHIIL.LHQWO\ +HUH,GHV.ULEHKRZ\RXKDYHWRDOWHUWKHPDNHILOHVIRU\RXURZQSURJUDPV PDNHGR.SGI 7KH.RPELQDWLRQRI&DQGDVVHPEOHULQVWUX.WLRQV 7KLVGR.XPHQWGHV.ULEHVWKHSRVVLELOLW\RILQVHUWLQJWKHDVVHPEOHULQVWUX.WLRQVLQ\RXU&SURJUDPVGLUH.WO\ RUWKURXJKPD.URV DVPGR.SGI 7KH.UHDWLRQRIYDULDEOHVILHOGVDQG.RQVWDQWVKRZWRXVHWKHP" 7KH$WPHO$95SUR.HVVRUVHULHVH[LVWRIGLIIHUHQWPHPRU\IRUPV+HUH\RXILQGWKHHPSKDVLVRQ ZRUNLQJZLWKWKHGLIIHUHQWSRVVLELOLWLHV 65$0VUDPGR.SGI 3URJUDPPHPRU\SURJPHPGR.SGI (HSURPHHSURPGR.SGI +RZ.DQ\RXXVH,2UHJLVWHUVDQGSRUWV" +HUH\RX.DQILQGWKHGHV.ULSWLRQRIWKHSURJUDPPLQJRI,2UHJLVWHUVDQGHVSH.LDOO\SRUWV LRGR.SGI +RZ.DQ\RX.UHDWHDQLQWHUUXSWURXWLQH" :KL.KLQWHUUXSWURXWLQHV.DQEH.UHDWHG" ([SODLQDWLRQVDUHVKRZQRQWKHH[DPSOHRIDQH[WHUQDOLQWHUUXSW,17DQG,17 LUTGR.SGI 3URSHUWLHVDQGXVHRIWKHWLPHU.RXQWHU +RZ.DQ\RXSURJUDPDQGXVHWKHGLIIHUHQWPRGHVRIWKHWLPHU.RXQWHUSHULSKHULDO" ELW7LPHU&RXQWHUWGR.SGI ELW7LPHU&RXQWHUWGR.SGI ELW7LPHUWGR.SGI +RZDUHGDWDWUDQVPLWWHGWKURXJKDVHULHOOLQWHUID.H" 5H.HLYLQJDQGWUDQVPLWWLQJRIGDWDZLWKWKH8$57PRGXOHLQWKH$95.RQWUROOHU XDUWGR.SGI $QDORJYDOXHVSUR.HVVLQJGLJLWDO 8VLQJWKHELW$QDORJ'LJLWDO.RQYHUWHULQWKHVLQJOH.RQYHUVLRQRUIUHHUXQQLQJPRGH DG.GR.SGI &RPSDULQJRIDQDORJYDOXHV +RZDUHWZRDQDORJYDOXHV.RPSDUHGZLWKPHDQVRID.RPSDUDWRU D.RPSGR.SGI KWWSZZZDYUIUHDNVQHW$95*&& How to adapt a makefile for your programms: In order to create an executable program (ownprog.rom) from a source file (ownprog.c) one ought to have some instructions. They need to be repeated after each change of program. To avoid this there is a more efficient possibility. The instructions are summarized and stored in a so called makefile. In order to carry out this makefile you need to have the program make, which has already been integrated in this compiler area. The makefile and the source file should be in the same directory. The makefile is carried out step by step through calling up the instruction make and so one gets the wanted program. The makefile needs two include files (make1,make2) as well. Both files contain parts of the whole makefile, which dont have to be changed for the use for the most part. Both files you can find in the directory ($avr)/include. For further information look up the program make and its helpfile. The structure of a possible makefile: # This part includes the make1 file of the include directory # include $(AVR)/include/make1 #Put the name of the controller you have used here.# MCU = at90s8535 #At this place you can insert a new name for the program but you should better keep the original name.# TRG = ownprog #These are names of your programs which should be translated.# SRC = owninc1.c owninc2.c ownprog.c #Put additional assembler source files here# ASRC = #Additional libraries and object files to link# LIB = #Additional includes to compile# INC = #Compiler flags# CPFLAGS =-g -O3 -Wall -Wstrict-prototypes -Wa,-hlms=$(<:.c=.lst) #Assembler flags# ASFLAGS = -gstabs #Linker flags# LDFLAGS = #Here the makefile includes the make2 file - which dont need to be changed.# include $(AVR)/include/make2 #Dependencies: The program make knows with its dependencies which parts of the program have to be translated or not. If owninc1 is changed, only the program itself and the program which includes owninc1, is translated. owninc2 is not translated again because there is no dependency to owninc1.# ownprog.o :ownprog.c owninc1.h owninc2.h owninc1.o :owninc1.c owninc1.h owninc2.o :owninc2.c owninc2.h How to integrate assembler instruction: Sometimes you need functions for programming that cannot be carried out through a C instruction or it seems easier to write a few assembler instructions. There are two possibilities to add an assembler code into the C sourcefile. The first possibility is to write the assembler instructions directly into the sourcecode and the second one is to write macros. Macros are always used in case you need the implemented function more often. The macros are always directly added at the place where they are called. Suitable assembler instructions you need for programming you can take out of the instructional sentence of the AVR processor series. The keyword asm must be together with the instructions so that the compiler realises that assembler instructions are given. You can put multiple assembler instructions together in a single asm template, separated wither with \n or with semicolons. Further labels can be defined that can be called up through jump instructions. Its not possible to jump from one asm to another asm area. After the input of the instructions, which are put in inverted commas, you can specify the characteristics of the used input variables, output variables or registers. A colon separates the assembler template from the first output operand and another separates the last output operand from the first input operand. If there are no output operands but there are input operands, you must place two consecutive colons that surround the place where the output operands would go. In addition to that the qualities of the operands can be determined through constrains. Constrains can say whether an operand may be a register, and which kinds of register; whether the operand can be a memory reference, and which kinds of address; wheter the operand may be an immediate constant, an which possible values it may have. Constrains can also require two operands to match. (=r) To make sure the instruction operates on the correct data type you need to use a typecast in the asm statements. (for example: :r ((uint8_t)(val)) ) Constrains: The ordinary output operands must be of the state write-only. Often used constrains: r The value is handed through a general register. i An immediate integer operand (0-255) is allowed. This includes symbolic constants whose values will be known only at assembly time. I I is defined to stand for the range of values 0 to 63. z The transfered value is loaded into the z-register (low byte -> R30, high byte R31) y The transfered value is loaded into the y-register (low byte -> R28, high byte R29) x The transfered value is loaded into the x-register (low byte -> R26, high byte R27) For the output parameters you have to put a = in front of the constrain parameter. Also, if your instruction does have a side effect on a variable that otherwise appears not to change, the old value of the variable may be re-used later if it happens to be found in a register. You can prevent an asm instruction from being deleted, moved significantly or combined by writing the keyword volatile after the asm command.If you write an asm instruction with no output the compiler knows that the instruction has side effects and will not delete them. If you write a header file write __asm__ instead of asm. Filling in the assembler instructions directly: Construction: ... asm volatile (operator operand;operator operand.... : input variables : output variables : used registers) ... example: /* a simple program to show the usage of assembler code in your c- programs 8/00 Leitner Harald */ #include<io.h> uint8_t val1, val2; int main(void) { outp(0xff,DDRB); val1 = 3; val2 = 4; asm volatile ("LDS R30,val1; LDS R31,val2; ADD R30,R31; RJMP do; LDI R30,0xFF; do:STS val1,R30;" ::); outp(~val1,PORTB); for (;;){} } /* use all pins on PortB for output */ /* start of the asm part*/ /* definition of jump labels */ /* write result of val1+val2 to Port */ Insert the assembler instructions through macros: The structure is similar to the normal insertion of assembler instructions. Through the creation of such macros and the integration under C you can easily make complex instructions. Construction: # define macroname(variablelist) \ ({ variables declaration list \ asm ( operator operand \ operator operand\ : output parameters\ : input parameters\ : used registers)\ }) The essential difference is that no fixed variables are indicated but placeholder who refer to the variables. These placeholders could also stand for bigger types of variables. For example: 1Byte : #define xyz (val) (\ asm volatile ( mov r30, %0 \ : /* no output */ \ : r (val)\ ) The placeholder %0 stands for the variable val. 2Byte: #define xyz (address) (\ asm volatile ( mov r30, %A1 \ mov r30, %B1 \ : /* no output */ \ : r (address)\ ) address is a 16 bit value which is seperated through %A1 and %B1 to a low and high byte. Example: /* simple program to show the usage of assembler code in your c-programs and how to define and run macros 8/00 Leitner Harald*/ #define outport(val, port)\ asm volatile (\ "out %1, %0"\ : /* no outputs */ \ : "r" ((uint8_t)(val)),\ "I" ((uint8_t)(port))\ ) #define DDRB 0x17 #define PORTB 0x18 typedef unsigned char uint8_t; uint8_t val1; uint8_t val2; int main(void) { outport(0xff,DDRB); val1 = 2; val2 = 4; asm volatile ( "LDS R30,val1; LDS R31,val2; ADD R30,R31; STS val2,R30":: ); outport(~val2,PORTB); (Leds) */ for (;;){} } /* call output macro and write result to PortB /* call output macro and */ /* use all pins on PortB for output */ The macro outport has two input parameters val and port. The placeholder %0 stands for the variable val and %1 for port. For the input parameters the type of both is mentioned ((uint8_t)). The field you can mention optionally for the used registers is not used. Variables in the SRAM: Variables that are defined in the program without any attributes are placed by the compiler into the SRAM of the controller. This memory is directly integrated, not with I/O registers. The advantage of this is that the reading and writing is faster than in other memory forms and you dont need other approaching functions. Frequently used integer data types are summarized in the include file <inttypes.h>. As soon as the file <io.h> is included, the data types of <inttypes.h> are automatically included as well. Constantes are filed trough giving the keyword const. This variables are of the state read only and cannot be altered. Pre-defined variables in the include file <inttypes.h>: name of the data typ Int8_t Uint8_t Int16_t Uint16_t Int32_t Uint32_t Int64_t Uint64_t length in byte 1 1 2 2 4 4 8 8 value range -128 to 127 0 to 255 -32768 to 32767 0 to 65535 -2147483648 to 2147483647 0 to 4294967295 -9.22*10^18 to 9.22*10^18 0 to 1.844*10^19 Definition: Creation of a variable in the SRAM: Uint_8 val = 8; Through this instruction a new variable val in the SRAM is filed and initialized with value 8. The variable reserves a one byte value. Alteration of the variable in the SRAM: Val = 10; Because of that the value that is on the given address that is mentioned through val is altered. Creation of a constante in the SRAM: Const uint8_t october = 10; Through this instruction a constante in SRAM is filed that is of the value 10. The name of this constante is october and can only be read but not written, because of that an alteration in the value is not possible. The filing of register variables: Register uint8_t alwaysused = 10; Through this instruction variables are created that are assigned to a register. This is especially useful for variables that are used frequently. Variables in the program memory: The memory of data in the program memory is very useful because the data are filed from the beginning and dont have to be created first. A possible application is the filing of the different sentences which have to be shown on a lcd display, in the program memory because they dont have to be altered. You could file the constants in the SRAM as well, but as however the program memory is larger than the SRAM and as the data dont have to be altered the memory in the program memory is a better alternative. When you download the program, the defined constantes are filed as a part of the program. The creation of these data is through the keyword __attribute__ ((progmem)). In order to avoid mentioning the keyword after the creation of a data record, suitable data types have already been designed in the include file <progmem.h>. This file also includes all access procedures that are necessary for the reading of the data. 8 bit data typ: prog_char Singular value: The creation of a constante in the program memory: prog_char LINE = {1}; Here value 1 is filed in the program memory. LINE obtains the address of where the value is situated. The reading of the constants: char res = PRG_RDB(&LINE) Through the address of LINE the value can be read and memorized in the variable res that is situated in the SRAM. Array: The creation of an array in the program memory: prog_char TEN[10] = {0,1,2,3,4,5,6,7,8,9}; Here you have the possibility of defining an open array. (prog_char TEN[] = {0,1,2,3,4,5,6,7,8,9};) Reading of the value TEN[5]: char res = PRG_RDB(&value[5]) With this instruction the value of TEN in position 5 is memorized into the variable res. 16bit data typ: prog_int 32bit data typ: prog_long 64bit data typ: prog_long_long The applications of the 16 bit(2Byte), 32 bit(4Byte), 64 bit(8Byte) data types correspond with those of the 8 bit data type. The only difference is that these types reserve more memory. Further applications: The filing of a character string in the program memory. Version1: The creation of a character string: Char *LINE1 = PSTR(The first line of my LCD display); This definition files the sentence in the program memory and leads the pointer back, that points to the first sign of the character string. The reading of a sign of the character string: Char lastchar = PRG_RDB (LINE1+42); The variable (in the RAM) lastchar now contains the 42th letter of the character string LINE1. Version2: The creation of a character string: Char LINE2[] __attribute__ ((progmem)) = this is an other version; With this definition a field is created in which the sentence this is an other version is filed. The reading of a sign of the character string: Char firstchar = PRG_RDB (&[LINE2[0]); The variable firstchar (in the SRAM) now contains the first letter of the character string LINE2. Special operation of approach in <progmem.h>: uint PRG_RDB(uint16_t addr); This function contains as an input the address where you can find the value in the program memory and as a return the value itself. PSTR(s); PSTR files a string in the program memory and provides a starting address. Variables in the eeprom (electrical erasable programmable read only memory): In contrast to the simple definition of variables in SRAM for the usage of the eeprom which is integrated through I/O registers you need special access procedures. This procedures can be found in the include file <eeprom.h>. Procedures: eeprom_wb (unsigned int addr, unsigned char val); This procedure allows to write the value val to a defined address addr. unsigned char eeprom_rb (unsigned int addr); With the eeprom_rb you can read a value (one byte) out of the eeprom address addr and this is directly handed over in the form value = eeprom_rb (addr); unsigned int eeprom_rw (unsigned int addr); With the eeprom_rw you can read a 16bit value (two byte) out of the eeprom address addr and this is directly handed over in the form value = eeprom_rw (addr); eeprom_read_block (void *buf, unsigned int addr, size_t n); With this procedure n values are read out of the address addr and written into the SRAM. The starting address in SRAM is transmitted with the *buf. int eeprom_is_ready (void); This function returns one if the eeprom is ready and zero if the eeprom is busy. The use of the procedures: First kind of use: It is possible to memorize a value directly on the eeprom. One only has to name an address and a value.You will soon lose back of things, if you draw up various values of this kind because you have to manage the addresses to the variables. example: /* This program stores the value $AA on the eeprom at the address $0. Then the value at address $0 is read and written to PORTB 10/00 Leitner Harald*/ #include <io.h> #include <eeprom.h> int main(void) { uint8_t val1 = 0xAA, val2; eeprom_wb(0x00, val1); val2 = eeprom_rb(0x00); outp(0xff,DDRB); outp(val2,PORTB); for (;;) {} } /* show val2 on PORTB */ /* file val1 at eeprom */ /* read eeprom at address $0 */ Here the value of the varaible val1 is memorized on the address 0 of the eeprom. Afterwards the value, you can find on address 0, is read and memorized in variable val2. This value is shown by the leds. Second kind of use: An assembler programmer is familiar with the first way, but it should be easier to handle in a higher language. Therefore there exists a more useful variation. A variable whose address is located in the surroundings of the eeprom is defined. Because of that you don't need an explicit address, you can take the one of the variable. The variable can be defined as follows: example: /* This program writes the value $AA in the variable val1 that is defined on the eeprom. Afterwards the variable val1 is read and written to PORTB 10/00 Leitner Harald*/ #include <io.h> #include <eeprom.h> int main(void) { /* That's the way to define a eeprom variable */ static uint8_t val1 __attribute__((section(".eeprom"))); uint8_t val2; outp(0xFF,DDRB); eeprom_wb ((uint8_t)&val1, 0xAA); /* writing the val1 */ val2 = eeprom_rb((uint8_t)&val1); /* reading of val1 */ outp(val2,PORTB); for (;;) {} } This example carries out the same function like the example of the first way of use, but the address is mentioned through variable val which is defined in the eeprom. There is also the possibility to put an array in the eeprom and read again: example: /* This program creates an array on the eeprom and writes different values into the array. Afterwards the val[4] is read and written to PORTB 10/00 Leitner Harald*/ #include <io.h> #include <eeprom.h> int main(void) { /* That's the way to define an array on the eeprom */ static uint8_t val[5] __attribute__((section(".eeprom"))); uint8_t val2; outp(0xFF,DDRB); eprom_wb ((uint8_t)&val[0], 0xAA); eeprom_wb ((uint8_t)&val[1], 0xBB); eeprom_wb ((uint8_t)&val[2], 0xCC); eeprom_wb ((uint8_t)&val[3], 0xDD); eeprom_wb ((uint8_t)&val[4], 0x00); val2 = eeprom_rb((uint8_t)&val[4]); outp(val2,PORTB); for (;;) {} } In this example an array field is defined with 5 values. The fields of the arrays get values one after the other and afterwards the whole string is read. In that way the indicator is sent back to the value array as a result. How to copy an array from the eeprom to the SRAM? /* writing the val[0] */ /* writing the val[1] */ /* writing the val[2] */ /* writing the val[3] */ /* writing the val[4] */ /* reading of val[4] */ Example: /* This program creates an array eepromval on the eeprom and writes different values into the array. Then the whole array is copied to the SRAM array sramval Afterwards the sramval[3] is read and written to PORTB. 10/00 Leitner Harald*/ #include <io.h> #include <eeprom.h> int main(void) { /* That's the way to define an array on the eeprom */ static uint8_t eepromval[5] __attribute__((section(".eeprom"))); uint8_t ramval[5]; outp(0xFF,DDRB); eeprom_wb ((uint8_t)&eepromval[0], 0x1); eeprom_wb ((uint8_t)&eepromval[1], 0x2); eeprom_wb ((uint8_t)&eepromval[2], 0x3); eeprom_wb ((uint8_t)&eepromval[3], 0x4); eeprom_wb ((uint8_t)&eepromval[4], 0x5); /* writing the eepromval[0] */ /* writing the eepromval[1] */ /* writing the eepromval[2] */ /* writing the eepromval[3] */ /* writing the eepromval[4] */ /* copy eepromval to ramval - length is 5 */ eeprom_read_block(&ramval,(uint8_t)&eepromval,5); outp(ramval[3],PORTB); for (;;) {} } With this function eeprom_read_block, whole blocks that are memorized in the eeprom can be memorized into the SRAM. For this you only need a starting address in the eeprom and the aim and the length of the blocks to copy. Programming I/O registers and using Ports: 1. How to use I/O registers: The peripherie that is used in AVR processor series is implemented through I/O registers. Because of that new values can not be fixed through simple allocations (impossible: PORTB = 0xFF). In order to work with these I/O registers you need special approaching operations, that are defined in the include file <iomacros.h> through assembler instructions. Instead of <iomacros.h> the include file <io.h> should be included. These I/O registers are so called special function registers (SFR) and are pre-defined in the processor specific file (for the AT90S8535: <io8535.h>). These registers are called through a fix address. BV(x): In the processor specific file (for example: <io8535.h> the register bit names are defined through their bit number (0-7) in the correct register ( for instance: the constante PINA6 is the 6th bit of PORTA and is of the value 6) One needs function BV (x) in order to come from the bits location to the correct value with which the register has to be loaded.( so BV (PINA6) creates as a return value 64 2^6) example: char result = BV(PINA6); result is now of the value 64 void sbi (uint8_t port, uint8_t bit): With this instruction you can set particular bits in the given register. The other bits stay the same. examples: sbi (PORTB, 3); sbi (PORTB, PINA3); Both functions set the 3rd bit of register PORTB. void cbi (uint8_t port, uint8_t bit): With this instruction you can delete particular bits in the given register. examples: cbi (PORTB,3); cbi (PORTB, PINB3); Both functions delete the 3rd bit of register PORTB. uint8_t bit_is_set (uint8_t port, uint8_t bit); This function checks the bit at the place bit in the register port. In case the bit is set this function has as a result 1, otherwise 0. This function can be used as a check for loops or if statements. example: uint8_t result = bit_is_set (PORTB, PINB3); result = 1 result = 0 if the 3rd bit of PORTB is set ,otherwise. uint8_t bit_is_clear (uint8_t port, uint8_t bit); This function checks the bit at the place bit in the register port. In case the bit is not set this function has as a result 1, otherwise 0. This function can be used as a check for loops or if statements. example: uint8_t result = bit_is_clear (PORTB, PINB3); result = 1 result = 0 if the 3rd bit of PORTB is not set ,otherwise. uint8_t inp (uint8_t port): With this function you can read and return a 8 bit value out of the mentioned register. example: uint8_t res = inp (SREG); Read the statue register SREG and put the value in the variable res. uint16_t __inw (uint8_t port): With this function you can read a 16 bit value out of the mentioned 16 bit register and bring it back. These registers are ADC, ICR1, OCR1A, OCR1B, TCNT1 (for processor AT90S8535) and must be read in a special range in order to obtain a correct 16 bit value. With this function it is possible that an interrupt is carried out during the reading process. example: uint16_t res = __inw (TCNT1); Read register TCNT1 and put the value into the variable res. uint16_t __inw_atomic (uint8_t port): These functions work like __inw but an interrupt is not possible. In this function __inw_atomic an assembler instruction (cli) is integrated that deletes the I-bit (global interrupt enable) of the status register. outp (uint8_t val, uint8_t port): With this function you can write the 8 bit value val into register port. example: outp(0xFF, PORTB); This instruction writes the value $FF into register PORTB. __outw (uint16_t val, uint8_t port): With this function a 16 bit value can be written into the register port. This is for initialising of the following registers: ADC, ICR1, OCR1A, OCR1B, TCNT1 (for processor AT90S8535) With this function it is possible that an interrupt is carried out during the writing process. example: __outw (0xAAAA, OCR1A); The 16 bit register OCR1A (output compare register A of timer 1) is initialised with value $AAAA. __outw_atomic (uint16_t val, uint8_t port): This function works like __outw but an interrupt is not possible. In this function __outw_atomic an assembler instruction (cli) is integrated that deletes the I-bit (global interrupt enable) in the status register. 2. How to use Ports: All AVR ports have true read-modify-write functionality when used as general digital I/O ports. This means that the direction of one port pin can be changed without unintentionally changing the direction of any other pin with the sbi (uint8_t port, uint8_t bit) and the cbi (uint8_t port, uint8_t bit)instructions. Each ports consist of three registers. registers: DDRX: This is the Data Direction Register of port X (instead of X use the right port character for example DDRA is the register for Port A). If you set this register to $FF the whole Port X is defined as output and if the register loaded with $00 the whole Port X is defined as input. You can set or clear only some pins with the instructions sbi (uint8_t port, uint8_t bit) and cbi (uint8_t port, uint8_t bit). example: outp (0xF0, DDRB); This instruction sets pin 0-3 of PORTB as input and pin 4-7 as output. PORTX: This is the data register of PORTX (X stands for A, B, C or D). If you want to put data to the port or read data from the port you have to use this register. example: outp (0xAA, PORTB); This instruction loads the data register of PORTB with the value $AA. In this case PORTB is used as output, so you have to initialize PORTB as output ($FF -> DDRB). char res = inp (PORTB); This instruction loads the value of the data register of PORTB into the variable res. In this case PORTB is used as input, so you have to initialize PORTB as input ($00 -> DDRB). PINX: PINX (X stands for A, B, C or D) is the input pin address of PORTX and is no register. When reading PORTX the PORTX data latch is read, and when reading PINX, the logical values present on the pins are read. The PORTX input pins are of the state read only, while the data register (PORTX) and the data direction register (DDRX) are of the state read/write. example: outp(0x00,DDRA); res = inp(PINA); With this instructions you can read the physical value of PORTA. Alternate functions: Most of the ports have alternate functions. Here several pins are used as an entry for the peripherie that is situated in the processor. These entries of the processor are allocated differently in the Atmel AVR series. example: AT90S8535: pin 0 of PORTB -> external counter input for timer/counter T0 Interruptprogramming with the GNU-C compiler Interrupts are used when you have to react fast to special incidents. These incidents are actuated either through the internal pheripherie or through external signals. During the running program an interrupt routine is called in order to analyse these incidents. There the interrupt is processed and jumped back to the place where the program has been left before. That an interrupt is licensed different bits have to be set in the suitable registers of the peripherie and the status register. For the use of the interrupt functions include the files <interrupt.h> and <signal.h>. <signal.h> includes possible interrupt names that have to be mentioned when they are used. Signal names: External interrupt0 function name: SIG_INTERRUPT0 External interrupt1 function name: SIG_INTERRUPT1 External interrupt2 function name (ATmega): SIG_INTERRUPT2 External interrupt3 function name (ATmega[16]03) SIG_INTERRUPT3 External interrupt4 function name (ATmega[16]03): SIG_INTERRUPT4 External interrupt5 function name (ATmega[16]03): SIG_INTERRUPT5 External interrupt6 function name (ATmega[16]03): SIG_INTERRUPT6 External interrupt7 function name (ATmega[16]03): SIG_INTERRUPT7 Output compare2 interrupt function name: SIG_OUTPUT_COMPARE2 Overflow2 interrupt function name: SIG_OVERFLOW2 Input capture1 interrupt function name: SIG_INPUT_CAPTURE1 Output compare1(A) interrupt function name: SIG_OUTPUT_COMPARE1A Output compare1B interrupt function name: SIG_OUTPUT_COMPARE1B Overflow1 interrupt function name: SIG_OVERFLOW1 Output compare0 interrupt function name: SIG_OUTPUT_COMPARE0 Overflow0 interrupt function name: SIG_OVERFLOW0 SPI interrupt function name: SIG_SPI UART(0) receive complete interrupt function name: SIG_UART_RECV UART1 Receive complete interrupt function name (ATmega161): SIG_UART1_RECV UART(0) Data register empty interrupt function name: SIG_UART_DATA UART1 Data register empty interrupt function name (ATmega161): SIG_UART1_DATA UART(0) Transmit complete interrupt function name: SIG_UART_TRANS UART1 Transmit complete interrupt function name (ATmega161): SIG_UART1_TRANS ADC Conversion complete: SIG_ADC Eeprom ready: SIG_EEPROM Analog comparator interrupt function name: SIG_COMPARATOR The structure of the routine: For the definition of such an interrupt routine you need to write the keyword SIGNAL or INTERRUPT. SIGNAL (SIG_NAME) { Here the instructions of the interrupt routine are processed. } The interrupt routine with the keyword SIGNAL is executed with disabled interrupts. Or: INTERRUPT (SIG_NAME) { Here the instructions of the interrupt routine are processed. } The interrupt routine with the keyword INTERRUPT is executed with enabled interrupts. Functionens of <interrupt.h>: Sei(): This function sets the I-bit in the status register and therefore enables interrupts. The individual interrupt enable control is then performed in separate control registers. Cli(): Deletes the I-bit in the status register and therefore avoids possible interrutps. enable_external_int (unsiged char ints): This function sets suitable bits in the GIMSK register (Mega series: EIMSK) in order to enable external interrupts. example: /* Turn on leds with switch on PD3 (Int1) Turn off leds with switch on PD2 (Int0) 10/00 Leitner Harald */ #include <io.h> #include <interrupt.h> #include <signal.h> SIGNAL (SIG_INTERRUPT0) /* PD2 */ { outp(0xFF, PORTB); /* turn off leds */ } SIGNAL (SIG_INTERRUPT1) /* PD3 */ { outp(0x00, PORTB); } int main( void ) { /* define PortB as Output (Leds) and PortD as Input (Switches) */ outp(0xFF, DDRB); outp(0x00, DDRD); /* enable interrupt Int0 and Int1 */ outp((1<<INT0)|(1<<INT1), GIMSK); /* falling edge on Int0 or Int1 generates an interrupt */ outp((1<<ISC01)|(1<<ISC11), MCUCR); sei(); for (;;){} } /* turn on leds */ This program switches through switch on PORTD.2 and PORTD.3 the leds on and off. The stiches are connected through interrupt entrances INT0 (PORTD.2) and INT1 (PORTD.3). Therefore an interrupt control is possible. First the bits INT0 (bit6) and INT1 (bit7) have to be set in the GIMSK register. Afterwards in the MCUCR register is adjusted to witch signal an interrupt has to be released. For each interrupt 2 bits have to be set. ISC00 (bit0) , ISC01 (bit1) ISC10 (bit2) , ISC11 (bit3) ISCX1 0 0 1 1 ISCX0 0 1 0 1 ... ... Interrupt 0 Interrupt 1 description the low level of INTX generates an interrupt reserved the falling edge of INTX generates an interrupt the rising edge of INTX generates an interrupt How to use Timer / Counter 0 ? General information: Timer0 is a 8 bit timer/counter which can count from 0 to $FF. In the timer mode this peripherie uses an internal clock signal and in the counter mode an external signal on PORTB.0. I take both mode of operation into consideration. Besides the timer can be operated either in the polling mode or in the interrupt mode. Used registers: Timer registers: TCCR0 TCNT0 Interrupt registers: TIFR TIMSK GIMSK (Timer/Counter 0 Control Register) (Timer/Counter 0 Value) (Timer Interrupt Flag Register) (Timer Interrupt Mask Register) (General Interrupt Mask Register) Timer mode: In this mode of operation the timer is provided by an internal signal. Whereas after each clock cycle the value of the TCNT0 register is increased by one.This clock signal is produced out of x times the amount of the oscillator signal. The factor x can have the following values: 1, 8, 64, 256, 1024 (for example: 1024 - the timer is increased after 1024 cycles of the oscillator signal) This prescaling is controlled by writing one of the following values into the register TCCR0: initial value 1 2 3 4 5 used frequency ck ck/8 ck/64 ck/256 ck/1024 Polling mode: Example: /* Testprogramm for Timer/Counter 0 in the Polling Mode If the Timer has an overflow the overlow bit in the TIFR register will be set and the led variable increased. The led variable will be written to the PORTB. Leitner Harald 07/00 */ #include <io.h> uint8_t led; uint8_t state; int main( void ) { outp(0xFF, DDRB); outp(0, TCNT0); outp(5, TCCR0); led = 0; for (;;) { do /* this while-loop checks the overflow bit in the TIFR register */ state = inp(TIFR) & 0x01; /* use all pins on PORTB for output */ /* start value of T/C0 */ /* prescale ck/1024 */ while (state != 0x01); outp(~led,PORTB); led++; if (led==255) led=0; outp((1<<TOV0),TIFR); } } In that way the register TCCR0 is loaded with 5 (ck/1024) and the starting value of the timer in the register TCNT0 is laid down with 0. After each 1024th cycle of the oscillator the value of TCNT0 is increased by one. The for(;;){} defines an endless loop. In this loop a do-while loop is inserted, that constantly checks, if the bit at the place 0 of the TIFR register is set or not. This bit has the name TOV0 (timer overflow 0) and is set when the 8 bit register TCNT0 is of the value $FF and tries to increase it -> overflow. In this case the do-while loop is left and the bontent of the variable led is written on PORTB. Afterwards the variable led is increased by one and checks if led is of the value $FF. In this case led is fixed to 0. Otherwise you have to write a one into register TIFR, which has as a consequence that the TOV0 is deleted and the timer starts counting from the beginning. /* if a 1 is written to the TOV0 bit the TOV0 bit will be cleared */ Interrupt mode: This mode of operation is used more often than the polling mode. In this case the TOV0 bit isn't constantly proved if it was set. Because in case of an overflow the controller jumps from the actual position to the suitable interrupt vector address. The interrupt is called from this vector address. After this execussion the program goes on the place, where it was interrupted. Example: /* Test program for Timer/Counter 0 in the Interrupt Mode Every time the Timer starts an interrupt routine the led variable is written on the PORTB and increased one time. Leitner Harald 07/00 */ #include <io.h> #include <interrupt.h> #include <signal.h> uint8_t led; SIGNAL (SIG_OVERFLOW0) { outp(~led, PORTB); led++; if (led==255) led = 0; outp(0,TCNT0); /* reload timer with initial value */ /* write value of led on PORTB */ } int main( void ) { outp(0xFF, DDRB); outp((1<<TOIE0), TIMSK); outp(0, TCNT0); outp(5, TCCR0); led = 0; sei(); for (;;){} } The interrupt routine is introduced trough the keyword SIGNAL. As soon as an overflow occurs, this interrupt routine is carried out. In the main program you have to fix the bits that enable the interrupt. In the register TIMSK you have to set the bit TOIE0 and through the command sei() the i-bit (global interrupt enable) is enabled in the status register (SREG). /* set global interrupt enable */ /* use all pins on PORTB for output */ /* enables the T/C0 overflow interrupt in the T/C interrupt mask register for */ /* start value of T/C0 */ /* prescale ck/1024 */ Counter mode: In this mode of operation the statue changes on the pin T0 are counted. Instead of the manual operation of entrance T0, a supply trough a frequency generator is equally possible. Following program counts the status changes on pin T0 and increase the value of the counter register TCNT0 by one. One has to pay attention that the pin T0 is situated on PORTB. Therefore pin 0 of PORTB has to be defined as an input and all others as an output. The next step is the definition of the right mode of operation. The value $6 has to be written into the register TCCR0. Now the timer/counter is configurated as a counter of falling edges to pin T0. Polling mode: Example: /* Test program for Counter 0 in the Polling Mode If the Counter has an overflow the overlow bit in the TIFR register will be set and the led variable increased. The led variable will be written to the PORTB. Leitner Harald 07/00 */ #include <io.h> uint8_t led; uint8_t state; int main( void ) { outp(0xFE, DDRB); /* use pin 1-7 of PORTB as output and pin 0 (T0) as input */ /* start value of counter */ /* init the T/C as counter triggered by falling edge on T0 */ outp(0xFE, TCNT0); outp(6, TCCR0); led = 2; for (;;) { do /* this while-loop the checks overflow bit in the TIFR register */ state = inp(TIFR) & 0x01; while (state != 0x01); outp(0xFE, TCNT0); outp(~led,PORTB); led++; if (led==255) led=0; outp((1<<TOV0),TIFR); } } /* if a 1 is written to the TOV0 bit the TOV0 bit will be cleared */ /* start value of counter */ Interrupt mode: /* Test program for Counter 0 in the Interrupt Mode Every time a falling edge is set on the T0 input the counter is increased for one time. Leitner Harald 07/00 */ #include <io.h> #include <interrupt.h> #include <signal.h> uint8_t led; SIGNAL (SIG_OVERFLOW0) { outp(~led, PORTB); led++; if (led==255) led = 2; outp(0xFE,TCNT0); } int main( void ) { outp(0xFE, DDRB); outp((1<<TOIE0), TIMSK); /* use all pins on PORTB for output */ /* enables the T/C0 overflow interrupt in /* reload counter with initial value */ /* write value of led on PORTB */ the T/C interrupt mask register for */ outp(0xFE, TCNT0); outp(6, TCCR0); led = 0; sei(); for (;;){} } /* set global interrupt enable */ /* start value of counter */ /* init the T/C as a counter falling edge on Pin T0 */ How to use Timer / Counter 1 ? General information In contrast to timer 0 or timer 2, timer 1 is a 16 bit timer/counter. Because of that you can use it for longer counter procedures. The counting extent is between $0000 and $FFFF. This area is being realised through two registers. Otherwise Timer 1 possesses compare/capture and a PWM. Used registers: Timer registers: TCCR1A TCCR1B TCCR1L TCCR1H OCR1AL OCR1AH OCR1BL OCR1BH ICR1L ICR1H Interrupt registers: TIFR TIMSK GIMSK (Timer/Counter Control Register A) (Timer/Counter Control Register B) (Timer/Counter Value Low Byte) (Timer/Counter Value High Byte) (Output Compare Register A Low Byte) (Output Compare Register A High Byte) (Output Compare Register B Low Byte) (Output Compare Register B High Byte) (Input Capture Register Low Byte) (Input Capture Register High Byte) (Timer Interrupt Flag Register) (Timer Interrupt Mask Register) (General Interrupt Mask Register) Timer mode: In this mode of operation the timer is supplied by an internal signal. After each takt cycle the meter reading is increased by 1. This signal is produced by a n times the amount of the oscillator signal. The factor x can have the following result: 1,8,64,256,1024 ( for instance: 1024- only after 1024 cycles of the oscillators the timer is raised- the frequency is only fosc/1024) This results can be set with register TCCR1B. The timer is adjusted through writing the following results into the register initial value 1 2 3 4 5 used frequency ck ck/8 ck/64 ck/256 ck/1024 Polling mode: Example: /* Test program for Timer/Counter 1 in the Polling Mode If the Timer has an overflow the overflow bit of the TIFR register is set and the led variable increased. The led variable is then written to PORTB. Leitner Harald 07/00 */ #include <io.h> uint8_t led; uint8_t state; int main( void ) { outp(0xFF, DDRB); outp(0x00, TCNT1L); outp(0x00, TCNT1H); outp(0, TCCR1A); outp(1, TCCR1B); led = 0; for (;;) { do /* use all pins on PORTB for output */ /* start value of T/C1 - low byte */ /* start value of T/C1 highbyte*/ /* T/C1 in timer mode */ /* prescale ck */ /* this while-loop checks the overflow bit in the TIFR register */ state = inp(TIFR) & 0x04; while (state != 0x04); outp(~led,PORTB); led++; if (led==255) led=0; outp(0x00, TCNT1L); outp(0x00, TCNT1H); outp((1<<TOV1),TIFR); } } /* start value of T/C1 - low byte */ /* start value of T/C1 - high byte*/ /* if a 1 is written to the TOV1 bit the TOV1 bit will be cleared */ The TCCR1A register is established with 0 the TCCR1B register with 1 (CK-one prescale) and the starting value of the registers TCNT1L and TCNT1H with 0. After each cycle of the quartz oscillators the meter reading of the TCNT1L register is increased by 1. After reaching the value $FF in register TCNT1L and renewed increasing the register, TCNT1H is increased by 1 and TCNT1L is placed to 0. There is a do-while loop addeded, which constantly controlls if the bit is in position 4 of the TIFR register or not. This register is called TOV1 (time overflow1) and is established if both 8 bit registers (TCNT1L, TCNT1H) are of the same value $FF and if it is tried to raise the valueoverflow. In this case the do-while loop is left and the content of the variable led is written on PORTB. Afterwards the variable led is increased by one and it must be prooved if led is of the value 255($FF). If this is the case led is put to 0. Otherwise one is written in position 4 of the register TIFR, which has the consequence that TOV1 bit is deleted and the timer has to begin to count once again. Interrupt mode: This mode of operation is used more frequently than polling. The TOV1 bit is not always controlled if it has been put. Because if there is an overflow the appropriate vector address is mentioned. The interrupt routine is called up of this vector address. After the work of this routine the programm goes at the point where it was interrupted. Example: /* Test program for Timer/Counter 1 in the Interrupt Mode Every time the Timer starts an interrupt routine the led variable is written on the PORTB and increased one time. Leitner Harald 07/00 */ #include <io.h> #include <interrupt.h> #include <signal.h> uint8_t led; SIGNAL (SIG_OVERFLOW1) { outp(~led, PORTB); led++; if (led==255) led = 0; outp(0,TCNT1L); outp(0XFF, TCNT1H); } /* reload timer with initial value */ /* write value of led on PORTB */ int main( void ) { outp(0xFF, DDRB); /* use all pins on port B for output */ outp((1<<TOIE1), TIMSK); /* enables the T/C1 overflow interrupt in the T/C interrupt mask register f outp(0xFF, TCNT1H); outp(0, TCNT1L); outp(0, TCCR1A); outp(5, TCCR1B); led = 0; sei(); for (;;){} } The interrupt routine is introduced through the keyword SIGNAL. As soon as an overflow occurs the routine is carried out. In the main program necessary interrupts must be enabled. In register TIMSK the bit TOIE1 has to be set and through the instruction the I-bit in the status register is enabled. In all other cases the timer is initialised like in the polling mode. /* set global interrupt enable */ /* no compare/capture/pwm mode */ /* prescale ck/1024 */ /* start value of T/C1 */ Counter mode: In this mode of operation the changes of the statue are counted on the external pin T1. In case of an overflow an interrupt routine is called up. Instead of the manual handling of entry T1, a supply through a frequency generator is equally possible. The program is in the most parts equal to that of timer0. One should pay attention that pin T1 is situated at PORTB. Because of that one has to define Pin1 of PORTB as an entry and all the others as an outlet. The next step is the determination of the suitable mode of operation. For that the value $6 is written into register TCCR1B. Now the timer/counter is configurated to pin T1 as a counter of falling edges. Compare mode: The Timer/Counter 1 supports two output compare functions using the registers OCR1A (low and high byte) and OCR1B (low and high byte) as the data sources to be compared to the content of the Timer/Counter register TCNT1 (low and high byte). If there is a compare match it is possible to clear the content of the Timer/Counter register (only if compare with OCR1A) or take effects on the output pins. This pins are called OC1A (PORTD.5) and OC1B (PORTD.4). The different functions are controlled by the register TCCR1A as follows: Bit 0-3: not used Bit 4: COM1B0 Bit 5: COM1B1 Bit 6: COM1A0 Bit 7: COM1A1 Mode Select: COM1X1 COM1X0 0 0 0 1 1 0 1 1 Description T/C 1 disconnected from pin OC1X Toggle the value of OC1X Clear OC1X Set OC1X The CS10, CS11 and the CS12 bit (bit0-2) of register TCCR1B defines the prescalling source of Timer/Counter 1 as follows: CS12 0 0 0 0 1 1 1 1 CS11 0 0 1 1 0 0 1 1 CS10 0 1 0 1 0 1 0 1 Description T/C 1 stopped CK CK/8 CK/64 CK/256 CK/1024 clocked by the pin T1, falling edge clocked by the pin T1, rising edge If you want to clear the content of Timer/Counter 1 on a compareA match, it is necessary to set bit3 in the register TCCR1B. In a compare match the suitable bit (OCIE1A -> bit4, OCIE1B -> bit3) is set in the TIMSK register or the interrupt routine (SIG_OUTPUT_COMPARE1A, SIG_OUTPUT_COMPARE1B) is carried out. example: /* Flashes LED on STK200 Board with Compare - Mode of Timer 1 Pulse width is regulated by switch PD2 and PD3 (Int0 Int1) 07/00 Leitner Harald */ #include <io.h> #include <interrupt.h> #include <signal.h> uint8_t delay; SIGNAL (SIG_OUTPUT_COMPARE1A)/* Compare interrupt routine */ { if (delay == 0) outp(0XFF, PORTB); else outp(0XFE, PORTB); } SIGNAL (SIG_OVERFLOW1)/* T/C1 overflow interrupt routine */ { if (delay == 0) outp(0XFF, PORTB); else outp(0XFF, PORTB); outp(0XFF, PORTB); outp(delay,TCNT1H); outp(0,TCNT1L); } SIGNAL (SIG_INTERRUPT0) /* PD2 */ { if (delay < 15) delay = 0; else delay = delay - 15; } SIGNAL (SIG_INTERRUPT1) /* PD3 */ { if (delay > 235) delay = 250; else delay = delay + 15; } int main( void ) { outp(0xFF, DDRB); outp(0x00, DDRD); delay = 120; /* default of timer1 high byte */ /* define PORTB as Output (Leds) and PORTD as Input (Switches) */ /* Switches PB3,PB4 for Interrupt 0 and 1 */ outp((1<<TOIE1)|(1<<OCIE1A), TIMSK); outp((1<<INT0)|(1<<INT1), GIMSK); outp((1<<ISC01)|(1<<ISC10)|(1<<ISC11), MCUCR); outp(delay, TCNT1H); outp(0, TCNT1L); outp(0XFF, OCR1AH); outp(0X10, OCR1AL); outp(0, TCCR1A); outp(1, TCCR1B); /* Compare value of T1 */ /* Init T1 */ /* Timer mode with no output */ /* counting with ck */ sei(); for (;;){} } This program shows a possible use of the compare function. The timer is initialized in the main program. To controll the delay of the compare mode there are two switches PD2 and PD3 on the STK 200 board. A variable delay is decreased by 15 when using PD2 and when using PD3 increased by 15. This value delay is loaded into the high-byte of the timer/counter register. Out of this value the timer tries to reach the overflow. Before it can reach an overflow a compare match occurs and the suitable interrupt routine is called up. Because of this routine a led on the board flashes. Afterwards the timer runs to an overflow and carries out the overflow interrupt routine. The led is switched off again and the timer new is initialised with the value delay. Capture mode: This mode of operation enables to memorize the actual value of Timer/Counter 1 through an external signal. When the rising or falling edge of the signal at the input capture pin ICP (PORTD.6) is detected, the current value of Timer/Counter 1 is transfered to the 16bit input capture register ICR1 (ICR1L, ICR1H). This sets the input capture flag ICF1 and is possible to call up a interrupt routine (SIG_INPUT_CAPTURE) if the bit TICIE1 (bit5 of TIMSK) is set. The most important thing is that you have to read the low byte (ICR1L), for a full 16bit register read, first. example: /* Flashes LED on STK200 Board with Capture - Mode of Timer 1 With each capture signal on PORTD.6 the actual value of timer 1 (high byte) is written at PORTB. 07/00 Leitner Harald */ #include <io.h> #include <interrupt.h> #include <signal.h> SIGNAL (SIG_OVERFLOW1) { outp(0,TCNT1H); outp(0,TCNT1L); } SIGNAL (SIG_INPUT_CAPTURE1) { outp(~inp(ICR1L),PORTB); /* reading timer value of capture register */ outp(~inp(ICR1H),PORTB); } /* and write to PORTB */ /* reset timer after overflow */ int main( void ) { outp(0xFF, DDRB); outp(0x00, DDRD); outp(0xFF, PORTB); /* Enable interrupt for capture and overflow */ outp((1<<TICIE1)|(1<<TOIE1), TIMSK); outp(0, TCNT1H); outp(0, TCNT1L); outp(0, TCCR1A); outp(5, TCCR1B); sei(); for (;;){} } This program reads the actual value of Timer/Counter 1 after a signal has occured on the pin ICP. Then the high-byte of this value is written to the Leds on PORTB. /* Init T1 */ /* define PORTB as Output (Leds) and */ /* PORTD as Input (Switches) */ /* Timer mode with no output */ /* counting with ck/1024 */ PWM mode: When the PWM (PulseWidthModulation) mode is selected the Timer/Counter 1 can be used as an 8,9 or 10bit, free running PWM. Timer/Counter 1 acts as an up/down counter that is counting up from $0000 to the selected top (8bit -> $00FF, 9bit -> $01FF, 10bit -> $03FF), where it turns and counts down to $0000 and repeats this cycle endlessly. When the counter value matches the content of the compare register (OCR1A, OCR1B) it has an effect on the output pins OCA1 and OCB1 as follows: COM1X1 0 0 1 COM1X0 0 1 0 Effect on OCX1 no no cleared on compare match, up-counting, set on compare match, down-counting cleared on compare match, down-counting, set on compare match, up-counting 1 1 These bits are set in the register TCCR1A. (COM1A1 -> bit7, COM1A0 -> bit6, COM1B1 -> bit5, COM1B0 -> bit4) The right PWM mode is selected bits PWM10 (bit0 of TCCR1A) and PWM11 (bit1 of TCCR1A) as follows: PWM11 0 0 1 1 example: /* Testprogramm for Timer/Counter 1 PWM Mode 10bit The T/C is used as a free running 10bit-PWM. The T/C is counting from $00 up to $3FF and after reaching $3FF the T/C is counting down to $00. This cycle repeats endless. When the counter value matches the content of the output compare register during counting up, PD5(OC1A) pin is cleared and if matches while counting down the PD5(OC1A) is set. PWM10 0 1 0 1 Description PWM mode disabled 8bit PWM 9bit PWM 10bit PWM When the counter value matches the content of the output compare register during counting up, PD4(OC1B) pin is set and if matches while counting down the PD4(OC1B) is cleared. Leitner Harald 07/00 */ #include <io.h> int main( void ) { outp(0xFF, DDRD); outp(0xB3, TCCR1A); outp(0x5, TCCR1B); outp(0x00, TCNT1L); outp(0x00, TCNT1H); outp(0xFF, OCR1AL); outp(0x00, OCR1AH); outp(0xFF, OCR1BL); outp(0x00, OCR1BH); for (;;){} } /* use all pins on port D for output */ /* init the counter */ /* init the counter */ /* value of T/C1L */ /* value of T/C1L */ /* value of Compare register A Low-Byte */ /* value of Compare register A High-Byte */ /* value of Compare register B Low-Byte */ /* value of Compare register B High-Byte */ This program creates a free running PWM signal on the two outputs OCA1 and OCB1. The two compare registers OCR1A and OCR1B define the pulswidth. Selected Mode: TCCR1A: 10bit PWM Com1A1 -> 1, COM1A0 -> 0 Cleared on compare match, up-counting, set on compare match, down-counting Com1B1 -> 1, COM1B0 -> 1 Cleared on compare match, down-counting, set on compare match, up-counting TCCR1B: prescale: ck/10 How to use Timer 2 ? General information: Timer2 is a 8 bit timer that counts from 0 to $FF. In the timer mode this peripherie uses an internal clock signal. Besides the timer can be operated either in the polling mode or in the interrupt mode. Used registers: Timer registers: TCCR2 TCNT2 OCR2 ASSR Interrupt registers: TIFR TIMSK GIMSK (Timer0 Control Register) (Timer0 Value) (Output Compare Register of Timer2) (Asynchronous Status Register) (Timer Interrupt Flag Register) (Timer Interrupt Mask Register) (General Interrupt Mask Register) Timer mode: In this mode of operation the timer is provided by an internal signal. The value of the TCNT2 register is increased by one after each clock cycle. This clock signal is produced out of x times the amount of the oscillator signal. The factor x can have the following values: 1, 8, 32, 64, 128, 256, 1024 (for example: 1024 - the timer is increased after 1024 cycles of the oscillator signal) This prescaling is controlled by writing one of the following values into the register TCCR2: initial value 1 2 3 4 5 6 7 used frequency ck ck/8 ck/32 ck/64 ck/128 ck/256 ck/1024 Timer2 is no Timer/Counter but only a Timer for internal signals. Polling mode: Example: /* Test program for Timer/Counter 2 in the Polling Mode If the Timer has an overflow the overlow bit in the TIFR register is set and the led variable increased. Then the variable led is written to PORTB. Leitner Harald 07/00 */ #include <io.h> uint8_t led; uint8_t state; int main( void ) { outp(0xFF, DDRB); outp(0, TCNT2); outp(7, TCCR2); led = 0; for (;;) { do /* this while-loop checks the overflow bit in the TIFR register */ state = inp(TIFR) & 0x40; /* use all pins on PORTB for output */ /* start value of T/C2 */ /* prescale ck/1024 */ while (state != 0x40); outp(~led,PORTB); led++; if (led==255) led=0; outp((1<<TOV2),TIFR); } } In that way the register TCCR2 is loaded with 7 (ck/1024) and the starting value of the timer in register TCNT2 is laied down with 0. After each 1024th cycle of the oscillator the value of TCNT2 is increased by one. The for(;;){} defines an endless loop. In this loop a do-while loop is inserted, that constantly checks, if the bit on the place 6 of the TIFR register is set or not. This bit has the name TOV2 (timer overflow 2) and is set when the 8 bit register TCNT2 is of the value $FF and tries to increase it -> overflow. In this case the do-while loop is left and the bontent of the variable led is written on PORTB. Afterwards the variable led is increased by one and checks if led is of the value $FF. In this case led is fixed to 0. Otherwise you have to write a one into register TIFR on position 6 , what has as a consequence that the TOV2 is deleted and the timer starts counting from the beginning. /* if a 1 is written to the TOV2 bit the TOV2 bit will be cleared */ Interrupt mode: This mode of operation is used more often than the polling mode. In this case the TOV2 bit isn't constantly proved if it was set. Because in case of an overflow the controller jumps from the actual position to the suitable interrupt vector address. The interrupt is called from this vector address. After this execussion the program goes on the place, where it was interrupted. Example: /* Test program for Timer/Counter 2 in the Interrupt mode Every time the Timer starts an interrupt routine the led variable is written on the PORTB and increased one time. Leitner Harald 07/00 */ #include <io.h> #include <interrupt.h> #include <signal.h> uint8_t led; SIGNAL (SIG_OVERFLOW2) { outp(~led, PORTB); led++; if (led==255) led = 0; outp(0,TCNT2); /* reload timer with initial value */ /* write value of led on PORTB */ } int main( void ) { outp(0xFF, DDRB); outp((1<<TOIE2), TIMSK); /* use all pins on PORTB for output */ /* enables the T/C2 overflow interrupt in the T/C interrupt mask register for */ /* start value of T/C2 */ /* prescale ck/1024 */ outp(0, TCNT2); outp(7, TCCR2); led = 0; sei(); for (;;){} } /* set global interrupt enable */ The interrupt routine is introduced trough the keyword SIGNAL. As soon as an overflow occurs, this interrupt routine is carried out. In the main program you have to fix the bits that enable the interrupt. In the register TIMSK you have to set the bit TOIE2 and through the command sei() the i-bit (global interrupt enable) is enabled in the status register (SREG). Compare mode: The Timer2 supports one output compare function using the register OCR2 as the data source to be compared to the content of the Timer2 data register TCNT2. If there is a compare match it is possible to clear the content of Timer2 data register TCNT2 or to take effect on the output compare pin OC2 (PORTD.7). The different functions are controlled by the register TCCR2 in the following way: Bit 0-2: used for prescale (CS20 -> bit0, CS21 -> bit1, CS22 -> bit2) Bit 3: CTC2 (Clear Timer on Compare Match) Bit 4: COM20 Bit 5: COM21 Bit 6: PWM2 Bit 7: not used Mode select: Com21 0 0 1 1 Com20 0 1 0 1 Description Timer2 disconnected from pin OC2 Toggle the value of OC2 Clear OC2 Set OC2 Bits 0-2 of register TCCR2 defines the prescaling source of timer2 in the following way: CS22 0 0 0 0 1 1 1 1 CS21 0 0 1 1 0 0 1 1 CS22 0 1 0 1 0 1 0 1 Description Timer2 stopped ck ck/8 ck /32 ck /64 ck /128 ck /256 ck /1024 If you want to clear the content of timer2 on a compare match it is necessary to set the CTC2 bit (bit 3) of the TCCR2 register. On a compare match the bit OCIE2 (bit 7) in the TIMSK register is set or a interrupt routine is called up (SIG_OUTPUT_COMPARE2). Example: /* Flashes LED on STK200 Board with Compare - Mode of Timer 2 Timer starts with value $10, if the counter register has the same value as the ocr register the Led will be switched on. If the timer overflow flag is set the leds will be switched off. Leitner Harald 07/00 */ #include <io.h> #include <interrupt.h> #include <signal.h> uint8_t delay; SIGNAL (SIG_OUTPUT_COMPARE2) { outp(0X00, PORTB); } SIGNAL (SIG_OVERFLOW2) { outp(0XFF, PORTB); outp(delay,TCNT2); } /* turn off leds on PORTB */ /* turn on leds on PORTB */ int main( void ) { outp(0xFF, DDRB); delay = 0x10; outp((1<<TOIE2)|(1<<OCIE2), TIMSK); /* enables interrupt of timer */ outp(delay, TCNT2); outp(0x80, OCR2); outp(7, TCCR2); sei(); for (;;){} } This program shows a possibility of using timer2 in the compare-mode. The timer2 is initialized in the main() function of the program. Value delay ($10) is the starting value for the register TCNT2 and the value of the compare register OCR2 is set to $80. Timer2 counts from $10 to $80. At this point the program calls the interrupt routine for the compare match up and turns on the leds on PORTB. Then Timer2 counts until an overflow has occured. Then the interrupt routine for the overflow is reached and the leds are turned off. Then the cycle starts counting endlessly from delay ($10). /* default value of timer */ /* value of compar register */ /* selected prescale : ck/1024 */ /* define PORTB as output (leds) */ PWM mode: When the PWM (Pulse Width Modulation) mode is selected, timer2 is used as a 8bit free running PWM. Timer2 acts as an up/down counter that is counting up from $00 to $FF, where it turns and counts down to zero and repeats this cycle endlessly. To choose this mode you have to set the bit PWM2 (bit 6) of the register...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Oakland University - EG - 120
Spring 2000 means - EG 120 - Test 1 : 27.5 / 30 Test 2 : 24.0 / 30 Test 3 : 21.3 / 30 Project : 13.5 / 15 (with a max of 18 with extra credit) Final Exam : 35.3 / 50
Cornell - ENGRD - 221
ENGRD 221 Prof. N. Zabaras HOMEWORKS 7 &amp; 8 Handed out: Thursday, 11 October 2007 Due: Monday, 22 October 2007 by 5 pm10/11/2007Notes: 1. Drop HW off in the designated homework box in Upson 123 2. Be sure that you indicate your recitation section (and yo
National Taiwan University - MKT - 846
Decision MakingMKT 846 Professor WestAgenda Lookingback.What clues can our &quot;information processing model&quot; provide? Evaluating Ad Effectiveness The Art of Persuasion Whatshould Levi Strauss &amp; Co. be doing? Relating attitudes to choiceThe role of
Wisc Eau Claire - WCC - 0708
2007 Blugold Open Hosted by University of Wisconsin Eau Claire Whitetail Golf Course September 21st, 2007 = WOMENS TEAM SCORE = = 6k Open = 1. 57 UW-La Crosse ( 24:20 2:01:39) = 1 6 Kristen Howe 24:07 2 7 Meghan Dugan 24:08 3 9 Katelyn Williams 24:13 4 11
Washington University in St. Louis - CSE - 131
CSE 131 Quest 1: Conditional Statements and TestingLab Section C, 2:30-4pm Wednesday, September 29, 2004This is an exam. You may use your notes and you may also use the CSE 131 web site. You may ask the TAs to clarify the directions, but there is to be
Michigan State University - CPS - 360
CPS 360 Review: Worksheet I Part I: Problems These questions are designed to make you restate what the major focus of this course is. 1. In this course, we have said we use computers for one main purpose. What is that purpose?2. In this course, we want t
Cornell - HASH - 0177
Biological Pest Management AGR 121Course Description Thiscoursewillemphasizethebuildingandmaintainingofhealthysoil,plantandinsectbiologicalcyclesasthekeytopestand diseasemanagement.Coursecontentincludesstudyofmajorcroppestsanddiseases,includingstructure,
Clarkson - MA - 383
MATH 383 SAMPLE TEST TWO ANSWER KEY Spring 2006Part One: True/False Circle T for true and F for false. 1. F If the relationship between X and Y is dened by the equation Y = 3X 5 then the correlation between X and Y will be zero. 2. T The correlation coec
Auburn - E - 7250
Independent Fault SetsRavi Chandra Paruchuri Auburn University Auburn , Alabama. Abstract This paper discusses the generation and use of independent fault sets in order to obtain the more global approach to automatic test generation. Independent faults w
Winona - COURSE - 410
COPOLYMER EQUATION n = proportion of monomer 1 and monomer 2 being incorporated into a polymer at some point in the reaction. This is given by the change in concentration of monomer 1 relative to monomer 2 as shown below. n = d[M1] d[M2] = (k11[M1][M1*] +
LSU - APPL - 003
Common Professional Staff Titles and Salary Ranges - July 2007 (based on 12 month salary levels) Title CodeN655 N655 N541 N541 N541 N332 N332 N257 N257 N088 N088 N088 N088 N650 N650 N650 N536 N536 N536 L862 L862 L862 L862 N269 N269 F775 F774 F731 F731 F7
Stanford - MERQE - 1035
Case 5:05-cv-03395-JFDocument 206Filed 01/23/2007Page 1 of 151 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28JOEL H. BERNSTEIN (admitted pro hac vice) CHRISTOPHER J. KELLER (admitted pro hac vice) LOUIS GOTTLIEB (admitted pr
USC - CS - 510
University of Southern CaliforniaCenter for Systems and Software EngineeringUniWord Case StudyCS 510 Fall 2007 Barry Boehm, USCUniversity of Southern CaliforniaCenter for Systems and Software EngineeringUniWord Case Study Background The Competition
RPI - BCBP - 4870
Protein Structure Determination, BCBP 4870, Fall 2007 Homework 2 due Nov 8, 2007 (A) Using a Bragg plane diagram, explain why a crystal with P2 symmetry (2-fold screw along the c1axis), has only even-numbered reflections in the c* direction. i.e. (001),
SUNY Buffalo - CSE - 563
Knowledge Representation and Reasoning Logics for Articial IntelligenceStuart C. ShapiroDepartment of Computer Science and Engineering and Center for Cognitive Science University at Bualo, The State University of New York Bualo, NY 14260-2000 shapiro@cs
SUNY Buffalo - CSE - 563
Knowledge Representation and Reasoning Logics for Articial IntelligenceStuart C. ShapiroDepartment of Computer Science and Engineering and Center for Cognitive Science University at Bualo, The State University of New York Bualo, NY 14260-2000 shapiro@cs
SUNY Buffalo - CSE - 563
Knowledge Representation and Reasoning Logics for Articial IntelligenceStuart C. ShapiroDepartment of Computer Science and Engineering and Center for Cognitive Science University at Bualo, The State University of New York Bualo, NY 14260-2000 shapiro@cs
Rose-Hulman - CS - 414
Maintainability RequirementsBasics: integrated problem adder integrated subject updater moderator controls restore pointsElaboration: Integrated problem adder:The problem adder is an integral to the maintainability of the system. With this tool, the sy
Rose-Hulman - CS - 414
Availability Requirements:Quick Rundown:Wants: -24/7 uptime -no corruption of data -code runs completely clean Needs: - work week (Sunday night Friday afternoon) long uptime - corruption handled - working backup systemElaboration:Uptime: Since this is
Rose-Hulman - CS - 414
CS 414 Software Engineering Team 3 Feb 10 Monday 2003 8:30 O259Leader: Stuart Ford Note Taker: Aydrian Howard Timekeeper: Fred PabonAGENDA Review Agenda Stuart Ford (1 min) o Make modifications if needed Current Items (5 min) o Presentation Available o
University of Toronto - ECE - 1770
THE DESIGN AND IMPLEMENTATION OF OPEN ORB V2 Gordon S. Blair, Geoff Coulson, Anders Andersen1, Lynne Blair, Michael Clarke, Fabio Costa, Hector Duran-Limon, Tom Fitzpatrick, Lee Johnston, Rui Moreira2, Nikos Parlavantzas and Katia Saikoski Distributed Mul
Dickinson State - EE - 437
ECE 437Homework - DC Motor DrivesYuvarajan1. The dc motor (Fig. 15.13(a)-both armature and field are supplied by full converters) has Ra =1.0 and Kv = 1.2 V/(rad/s). The dc motor operates with a constant field current If = 0.75A which is 60% of the max
Bowling Green - CS - 2310
Chapter 13: Data StructuresChapter 13Data StructuresJava ProgrammingFROM THE BEGI NNI NG1Copyright 2000 W. W. Norton &amp; Company.Chapter 13: Data Structures13.1 Multidimensional Arrays Multidimensional arrays have more than one dimension. Java allo
Cal Poly - CPE - 269
CPE 229 Course Notes: Lecture 8Copyright: 2005 Bryan MealyYet Another Real Story FSMs are primarily used to control other circuits. It is possible to make a FSM that will output a desired counting sequence (namely counters) but that is more an academic
Mich Tech - GENENG - 1101
Engineering Analysis and Problem SolvingWelcometo ENG11011So Why Choose Engineering?1. 2. 3. 4. 5. 6. 7. 8. 9. 10.Job Satisfaction Variety of Career Opportunities Challenging Work Intellectual Development Potential to Benefit Society Financial Secur
National Taiwan University - COB - 525
212 ReviewBasic Cost Behavior9/12/02Prof. Bentz1Basic Model of Total Cost In A&amp;MIS 212, we use the basic model of total cost, Independent TC = F + vQ VariableDependent Variable Parameters (coefficients)9/12/02Prof. Bentz2Model Characteristics
Washington - EE - 485
Autumn 2008EE485 Homework #2 Solutions 1. (30%) Electromagnetic wave and attenuation. Light with = 650 nm in free space is focused uniformly into a spot size of radius 1 mm on the surface of a semiconductor. Assume 5 mW of optical power enters the semico
Wisconsin - CS - 564
%!PS-Adobe-2.0 %Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %Title: class.dvi %Pages: 18 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %DocumentFonts: CMBX12 CMR12 CMSS12 CMSY10 CMBX9 CMR9 CMR10 CMBX10 %+ CMTI10 CMMI10 CMTT10 %DocumentPaperS
University of Toronto - CS - 324
University of Toronto CSC324Principles of Programming Languages, Summer 2001Course Information LecturerDiana Inkpen ofce: phone: e-mail: Wed 4:30-6, Thu 2-3:30 SF4301B 416-978-4299 dianaz@cs.toronto.edu SF2303DOfce HoursInformation SourcesThe web pag
National Taiwan University - AEDE - 205
AEDE 205 Spring 2007 Homework 3 Due Monday, April 23, 2007 (Note: there is no need for Excel for this weeks homework so we will not hold lab. However, the TA will have office hours during the times when he would normally hold lab. Office hours are held in
Canisius College - M - 122
M 122 Review for Test II Sections 2.1 - 2.5, 2.7 &amp; 4.1 - 4.3Name_Determine if the graph of the function is concave up or down and give the coordinates of the vertex. 1) y = (x - 4)2 + 3 1) 2) y = -(x + 5)2 - 5 Algebraically find the coordinates of the v
Binghamton - CS - 350
CS 350: Final Exam (Fall 2005)12/9/2005 Please read the following paragraph carefully. The exam is out of 200. You get 40 points as a holiday gift! Answer 160 points worth of questions. If you answer more than the required questions, I will throw away/sc
Fayetteville State University - PHY - 2054
Appendix A Hitachi V-222 OscillscopeFIRST TIME OPERATION Insert the plug of the power cord on the rear panel into the power supply wall socket and set the controls as follows.POWER INTEN FOCUS AC-GND-DC POSITION V. MODE TRIG SOURCE INT TRIG TIME/DIV POS
UC Riverside - STAT - 170
Homework 1 (Due: 10/11/2002)Problem 1: DS book, page 108-109. Problem Y: 1, 2, 3, 4, 5, 6. Solution: See the Appendix of the Book. Problem 2: DS book, page 96. Problem A: 1, 2, 3, 4, 5 Solution: See the Appendix of the Book. Problem 3: DS book, page 99.
Washington University in St. Louis - VO - 1055
CCSD3ZF0000100000001NJPL3IF0PDS200000001 = SFDU_LABELRECORD_TYPE = STREAMOBJECT = TEXT NOTE = &quot;Description of software provided with the Viking CD-ROM set&quot; PRODUCT_CREATION_TIME = 1990-12-21END_OBJECT = TEXTEND Decompression Software The SOFTWARE
Lake County - LIFE - 355
PCR-Based Detection of Genetically Modified Soybean and Maize in Raw and Highly Processed FoodstuffsC. Tengel, P. Schler1, E. Setzke1, J. Balles, and M. Sprenger-Hauels1 Labor L+S AG, Bad Bocklet, and 1QIAGEN GmbH, Hilden, GermanyBioTechniques 31:426-42
NYU - ATM - 262
two cycles of n(t) (t:0-&gt;2), seed 115, N=12550 40 30 20 10 0 Row 7 -10 -20 -30 -40 -50 0.04 0.12 0.2 0.28 0.36 0.44 0.52 0.6 0.68 0.76 0.84 0.92 1 1.08 1.16 1.24 1.32 1.4 1.48 1.56 1.64 1.72 1.8 1.88 1.96 0 0.08 0.16 0.24 0.32 0.4 0.48 0.56 0.64 0.72 0.8
UNC - ECON - 434
Econ 434: History of Economic DoctrinesQuestions from Previous Versions of Quiz 11. A view that all phenomena conform to inherently stable and universal principles is least consistent with the concepts that underpin: (a) scientific laws about the cosmos
LA Tech - BAK - 406
Maryland - M - 140
MATH 140: Calculus I Calculus is a central pillar of education in the quantitative sciences. It provides the language and conceptual framework to analyze change and accumulation. At the University of Maryland, Math 140141 is the basic sequence of calculus
Allan Hancock College - CS - 9242
54321DDUSBPower 6 5 2 1 C6 100nFCD3 3 4 R4Q1 3 HAT1043M 4ZHCS2000 1 2 5 6 1KCU1 J2 VBus DD+ ID(NC) Gnd Shield USB - Mini B 1 2 3 4 5 Shell R1 C1 1M 100nFBL14.7uH4 20 16 15 19 27 28 17 C5 100nFVCCIO VCC USBDM USBDP Reset OscI OscO 3V3Out
Allan Hancock College - CS - 9242
OKL4 Microkernel Reference ManualAPI Version 0316Open Kernel LabsDRAFTDocument Number: Software Version: Date:OK 10000:2006 (revision 10) 2.1 June 17, 2008Copyright 20062008 Open Kernel Labs, Inc. Copyright 2006 National ICT Australia Limited This p
Allan Hancock College - CS - 9242
Intel IXP42X Product Line of Network Processors and IXC1100 Control Plane ProcessorDeveloper's ManualMarch 2005Document Number: 252480-005Intel IXP42X Product Line of Network Processors and IXC1100 Control Plane Processor ContentsINFORMATION IN THIS
Allan Hancock College - CS - 9242
Iguana Reference ManualOpen Kernel LabsDRAFTDocument Number: Software Version: Date:OK 40008:2007 (revision 4) 2.1.1 May 9, 2008Copyright 20072008 Open Kernel Labs, Inc. This publication is distributed by Open Kernel Labs Pty Ltd, Australia. THIS DOC
Allan Hancock College - CS - 9242
Elfweaver Reference ManualOpen Kernel LabsDRAFTDocument Number: Software Version: Date:OK 40000:2007 (revision 7) 2.1.1 June 17, 2008Copyright 20072008 Open Kernel Labs, Inc. This publication is distributed by Open Kernel Labs Pty Ltd, Australia. THI
Allan Hancock College - CS - 9242
Integrated Device Technology, Inc.IDT79RV4700TM RISC Processor Hardware User's ManualVersion 2.1 December 19972975 Stender Way, Santa Clara, California 95054 Telephone: (800) 345-7015 TWX: 910-338-2070 FAX: (408) 492-8674 Printed in U.S.A. 1996 Integra
Allan Hancock College - CS - 9242
System Controller for RC4640, RM523X and VR4300 CPUs FEATURES Integrated PCI system controller for high-performance cost sensitive embedded applications Support the following 32-bit bus CPUs:- IDT RC4640 and RC4650 (in 32-bit mode) - QED RM523X - NEC/To
Duke - CPS - 296
H XR X |zsi R I I U ` u ` Y 8WBU b u ` U e@W D VVQXvfph V1CgXB bh Y W b i W Y Uh bh U @ ` B i W m ` @ W b ` b ` wB b W W wB pQfs&quot;%ppfCVXsQVvggu&quot;atcQgtgW p y&quot;V~&quot;vB q yw Wq k b 8 W R |XVQCTfX%VyE4pQVQv&quot;vgVzTsVXxVXsQVgTW p g UI b ` U 8 W @ W e ` U W mh F Yq
Michigan State University - ME - 410
ME 410Spring 2008Homework 10 Due: March 27, 20081. Air at 4E-4 kg/s and 27C enters a triangular duct that is 20 mm on a side and 2 m long. The duct surface is maintained at 120C. Determine the air outlet temperature.2. Determine the surface temperatur
Washington University in St. Louis - CS - 342
CS 342: OO Software Development LabTools and TechniquesUnix High-Level OverviewCS 342: Object-Oriented Software Development LabUser interaction with Unix Useful Unix Command Categories The Shell For further informationUnix High-Level OverviewDavid L
Oakland University - CSE - 411
CSE411 AutomataDecember 3, 2003Homework 10Due Date: December 10, 2003 1. Problem 6.3.3, page 292. 2. Problem 6.4.2, page 299. 3. Problem 7.1.1, page 308. Total points: 50 (20 points) (10 points) (20 points)1
Penn State - IST - 104
Spring 2007Angsana A. TechatassanasoontornIST 220 Networking and TelecommunicationsNetwork Lab Assignment 2 Constructing a Local Area NetworkDue date: Mar. 9, 2007Acknowledgements: This lab assignment was developed by Dr. Peng Liu and Hai WangProjec
IUPUI - CGT - 110
TECH 104 Technical Graphics CommunicationWeek 15:Design in Industry &amp; Applications of 3D CADVisualizationHelpsanyandeveryoneunderstandthe object/system/process. Etc.RapidPrototyping(RP) FusedDepositionModeling(FDM) LaminatedObjectManufacturing(LOM)
UCSB - LINKS - 297
ESM 297Renewable Energy Law and Policy Week 5: Vehicle fuel efficiency policyTam Hunt Energy Program Director/Attorney Community Environmental CouncilThe National CAF standards Created in 1975 by the Energy Policy and Conservation Act CAF standard cur
Cornell - P - 317
11Elementary particlesAll exercises below refer to the book by Serway, Moses, and Moyer. Exercise 11.1: Fundamental forces Exercise 15.02 Note: When asked to explain, please explain how it can be that the decay rates of the two processes mentioned in th
Georgia Tech - MATH - 3770
Math 3770 BProbability and StatisticsSpring 2006Instructor: Hua Xu; Skiles 127A; Email xu@math.gatech.edu; Web www.math.gatech.edu/~xu; Phone 404-894-2695; Office Hrs T,Th 10:30am~noon, or by appointment. Meeting Time: MW 3:05-4:25pm; Webber SST 2 Grad
Lake County - CI - 321
SOUTHERN ILLINOIS UNIVERSITY AT CARBONDALE DEPARTMENT OF MATHEMATICS COURSE INFORMATION, Fall 2004CI/Math 321, Section 001 Mathematics Content and Methods for the Elementary School III Cheng-Yao Lin Wham 326A 618-453-4236 cylin@siu.edu OFFICE HOURS: Mon:
Cal Poly Pomona - CS - 411
ScheduleCS 411 Winter 2007 Craig A. RichMondayWednesday3Friday Homework 1 assigned581012Jan15Martin Luther King Day Jan22Homework 1 due Phase 1 assigned Project groups due Homework 2 due Phase 1 due Phase 2 assigned17Homework 2 assigned19
Knox College - CS - 205
CS 205: Algorithm design and analysis Fall Term, 2008Homework 5Due: Monday 9/29 at 11:59pmComplete the following, which can be submitted via email or on paper: 1. A key to customer service is to avoid having the customer wait longer than necessary. Tha
Cox School of Business - P - 1307
Physics 1407 Test #3 (Practice) Fall 2004 NAME: SSN: This test consist of twenty multiple choice questions. Each question is worth five points. Please staple all your worksheets together with the test and turn-in together with your answer sheet. DATE:1.
Penn State - LAE - 91024
WEIGHTED SUITE1024X768X32@85 128-2 BIOS .1024X768X32@85 P5STD/512 3.1024X768X32@85 STE512/166 .UNITSCD-ROM WinMark 97837 [1,2] 780 [3,4,5] 824 [4,5,6] Thousand Bytes/SecCPUMark16331326 [3] 312 [6] CPUmark32343340 [3] 315 [6] Business