PIC MicroController Training

Size: px
Start display at page:

Download "PIC MicroController Training"

Transcription

1 PIC MicroController Training Conduct by : Bill Sim simhkeng@yahoo.com 1

2 Practical Microchip PIC16F877A Development using MikroC ( Software/Hardware) Conduct by : Bill Sim simhkeng@yahoo.com Date : 28 Aug 08 PICDEM 2 Plus Board 2

3 Topics covered PICDEMO2 Development Board Digital I/O Hardware interrupt Timers interrupt Serial port Read/Write Internal EEProm ADC Measurement LCD display Pulse Width Modulation - PWM IIC Support Boot loader download Serial port programmer QL200 PIC Development Board ( China ) External EEProm programming Real Time Clock DAC Measurement 3

4 PICDEMO2 PIC Development Board 9V Power Serial Port LED display RB4-RB1 20MHZ Crystal LCD Display Analog input RA0 Program download port Reset button RA4 Button RB0/Interrupt Button 4

5 PICDEMO2 PIC Development Board Interface wiring position 5

6 General Information 6

7 Why Need Microcontroller Need intelligent in the hardware Simplify hardware circuit by firmware Easy to modify/upgrade for new requirement Use less external components ( e.g. build in Analog-to-Digital converter ) Microcontroller ( Intelligent ) Type of microcontrollers: Sensors (Analog/Digital Input) 7 Output (control) - Microchip PIC series such as PIC84, PIC16F877 - Intel Atmel AT90S Motorola 68HC11 - Others

8 Microcontroller A single-chip( semiconductor) computer Incorporate the supporting chip such memories, input/out, ADC, clock circuit into a single chip For simple application, it can operate by itself with minimum components. Operate on a set of instructions ( program ). It fetches the instructions from it program memory, decode the instruction and then execute the required operation. Traditionally programmed by assembly language, but difficult to learn and maintain. Also assembly language different significantly from controller to controller. High level programming language use are C-language or BASIC Mostly are 8 bits, but 16bit or 32 bit microcontroller also available 8

9 Microcontroller Address decoder Timer CPU I /O Ports Digital / ADC / UART etc ROM RAM Inputs / Outputs circuit microprocessor Address address data Control signal Read/write Memory Memory bank microcontroller A microprocessor system Operate in RISC ( reduced instruction set computer) data is 8 bits, but instruction word in 12, 14 or 16 bits to allow the instructions to fetch and execute in one cycle thus speed up the execution process [ CISC ( Complex Instruction Set Computer) both data and instructions are 8 bits wide. CISC microcontroller usually has more than 200 instruction. Code and data are on the same bus and cannot be fetched simultaneously ] 9

10 Why use PIC? Supported by C language, BASIC Have build in Digital I/O and Analog inputs Digital/Analog pins are configurable Build in flash program memory, EERPOM data memory and data memory Build in oscillator circuit( R/C low speed ) or external oscillator Low power and flexible in supply voltage 1K to 32K bytes of flash EEProm program memory Timers, interrupts 33 input ( Analog/Digital ) or output pin Support USART, SPI and I2C Operating clock from 4MHZ to 40 MHZ Flexible voltage supply from 2V (battery) to 5.5V 10

11 PIC Microcontroller Architecture Power supply range from 2V to 5.5 Volt. Some may have standby feature (in ua current) to allow operate by standby battery. Power Reset/Reset input use to reset or initialize the microcontroller externally. It is connected to an R/C circuit which create a reset pulse at power up. It also include a push button for user to reset the circuit if required. Clock the heart beat of a microcontroller. Can be internal R/C, external R/C, crystal (high speed and accurate ). All instruction set execution speed is a multiple of the clock cycle. For PIC, an instruction cycle takes 4 clock periods. Memory RAM, Flash EEProm ( program and data memory) RAM general purpose memory to store data in a program Flash EEProm( program memory ) use to store user program. Nonvolatile and fast. Can be reprogrammed. Normally range from 1K to 32K or higher depending on the microcontroller. Flash EEprom (data memory ) use to store data that required for next power up operation. Range from 256 to few Kbytes. Can be programmed by application software. 11

12 PIC Microcontroller Architecture Timer/counter ( general purpose ) a counter that is driven from external or internal clock. It can be 8 bit or 16 bit and can be software controlled. The counter initial value can be preloaded. After start counting and reaches overflow, an interrupt will occur or an internal bit will change state to allow user to write application. User will then reprogram the counter, do all the necessary bits reset and start counter/timer again. Watchdog timer use to detect a system problem, such as hang up. Commonly use in real time system where the successful termination of one or more activities must be check regularly. 12

13 PIC Microcontroller Architecture Interrupt an interrupt causes the microcontroller to response to external/internal events immediately when it occurs without the need to check on the events. When interrupt occur, the microcontroller will stop its normal operation, save up all the required information and go to execute an special portion of program called interrupt service routine (ISR). After the execution of the ISR, the microcontroller will resume its normal operation. For bigger system, there is different level of priority for interrupt from different devices which can be programmed. Brown-out Detector reset the microcontroller when the power supply voltage falls below a certain value. This prevents the unpredictable operation at abnormal power supply and also prevent the EEprom from corrupted. Sleep mode consume minimum power ( in ua ), only certain intended monitoring is working to allow the circuit to work with battery. Wake up from sleeping mode when there is a reset or the monitoring device is activate. 13

14 PIC Microcontroller Architecture Input/Outputs (build in) Digital I/Os Analog to Digital converters Serial interfaces : UART, SPI, I2C Pulse Width Modulation output USB interface LCD driver Ethernet interface Motor controller interface 14

15 Feature of PIC16F877 Features Program Memoryn (Flash EEProm) Data Memory EEProm I/O Ports ADC ( 10 bits ) Timers External Interrupt Comparator USART (Serial Port) SPI I2C CCP(PWM) PIC16F877A 8K x 14 bit 368 byte 256 byte x 8bit, 1x16bit 1RB0, 4 in group 2 1 hardware Yes Yes 2 15

16 Pin out of PIC16F877 Flash Programing ADC Hardware Interrupt Crystal PWM RS232 I2C 16

17 Design Consideration Programming Language Programming languages ( in additional to assembly language) there are two languages : C language and Basic Language Recommend to use C- Language for better hardware control. Compiler to use If you choose C-language, you have to use C-compiler mikroelektronika offer a free ( with size limitation ) and easy to use compiler with lot of examples. 17

18 Design Consideration Program Download Programmer to use After compiled the program to the Hex code, you need a programmer to download the Hex code to the microcontroller s code memory (flash). 3 methods : * buy the programmer from the chip suppler * design your own programmer. * boot loader method Buy programmer PICkit2 from Microchip company It come with the hardware and software. There is also another development board for starter using 16F690 that you can use in conjunction with this programmer. the programmer uses USB as interface to the PC. Application program is provided for downloading program from PC to the PIC microcontroller. 18

19 Design Consideration Program Download Design your own programmer ( hardware & software ) Hardware there are many information on internet on how to design the serial programmer for the PIC. A simple one is to use PC s serial port where you suppose to get 12V from the serial port pin to program the PIC. A slightly complicated one is to use external power adapter to provide the 12V but still use serial port for this purpose. This is useful if some PC does not give you stable 12V Software After you have the hardware made, you need to have the programmer s software. A free software called WinPic is the best programmer software found so far. You can download from the following site : 19

20 Design Consideration Program Download Boot loader method boot loader is a small piece of firmware that reside inside a microcontroller s code memory and is responsible for downloading future application firmware developed to the microcontroller PIC product to use is 16F877A and above the boot loader and its application program used is FREEware boot loader firmware have to be pre-programmed only once using standard programmer use serial port to download the application firmware developed crystal use is 20MHZ, baud rate of the serial port is 38400bps Boot loader s application program, called PICdownloader, is installed on a PC for downloading purpose Select the Hex file to be download, com port and the baud rate and click the write button. Power OFF/ON the board and the firmware will be downloaded into the controller 20

21 Design Consideration Program Download Boot loader method Reset the target board 21

22 Digital I/O Port A/B/C/D/E PIC 16F877A Digital IO A B C D E 22

23 Digital I/O Your will learn : Hardware How to program digital I/O ports and application How to use push button Switch and eliminate debounce How to flash LEDs Software How to output byte data to hardware port How to handle bit wise ( Input/Output ) for a hardware port How to use delay_ms subroutine How to make human readable flashing 23

24 PortA/E Configuration PortA and PortE can be configured as Digital IO or Analog input (ANx) Two registers need to be configured : ADCON1(A/D control register) and TRISA(data direction register) Analog pins need to define as input pins Bits configuration For RA0 to RA3, RA5, RE0 to RE2 ADCON1 Register TRISA/E Register PortA/E pins Digital input or Digital output or Analog pin Define Digital or analog pin Define input or output pin Note : RA4 is open collector pin To define porta as all digital IO, ADCON1 = 0x06; To define porta as all output pins TRISA = 0x00; To define porta as all input pins TRISA = 0xff; 24

25 ANCON1 Configuration The configuration table for ANCON1 is shown below : only the first 4 bits is used 25

26 PortA/B/C/D/E Configuration PortA/B/C/D/E can be configured as Digital IO via data direction registers TRISA, TRISB,TRISC, TRISD & TRISE Bits configuration TRISX Register Digital input or Digital output Define Digital or analog pin for PORTA/B/C/D/E where X = A or B or C or D For example,to define Port D, bit 0 to 3 as digital input and bit 4 to 7 as digital output, TRISD = 0x0f; 26

27 MikroC Statements Some C Programming statements Write to a port or register byte wise TRISB = 0xff; PORTB = 0x0a; Read from a port or register byte wise If ( PORTB = = 0x38 ) { } Write to port or register bit wise PORTB.F1 = 1; // bit 1 of PORTB Read from a port or register bit wise If ( PORTB.F0 = = 0 ) { } If ( ( PORTB & 0x01) == 0x00 ) { } Complement a port PORTB = ~PORTB ; // 1 become 0, 0 become 1 27

28 MikroC Statements Some C Programming statements Delay time in milliseconds delay_ms (int number); e.g. delay_ms(500); Delay time in microseconds delay_us(int number); e.g. delay_us(200); Variable delay time in milliseconds int mydelay; mydelay = 300; Vdelay_ms( mydelay); 28

29 Interrupts Hardware Interrupt Timer0 Interrupt Multiple Interrupt 29

30 Hardware Interrupt Your will learn : Hardware What is hardware interrupt How use hardware interrupt in 16F877A Parameters that need to consider for interrupt Software How to write interrupt service routine How to program INTCON & OPTION_REG registers Timer 0 interrupt How to handle multiple interrupt 30

31 Interrupt Interrupt is used to reduce the workload of the CPU. A special job will only be done when the interrupt occurs. This special job is placed as part of the software program called interrupt service routine (ISR). CPU will perform its normal operation till an interrupt occur. When it happens, the CPU will stop its normal operation, save up all the registers and then execute the interrupt service routine till its completion. It will then back to its normal operation. When enter into ISR, it is a good practice to disable the interrupt. This is to prevent response to another interrupt when the previous ISR has not completed yet. Before exit the ISR, the interrupt need to be enabled and ready for another hardware interrupt. For 16F877A, there are 3 user defined interrupts ( in additional to 16F877 s standard peripheral interrupts). They are : hardware interrupt ( RB0/INT), Timer0 interrupt and RB4-RB7 group interrupt Other interrupt provided for the feature of 16F877 is called peripheral interrupt and is important for assembly language or C library programmer 31

32 Interrupt Flow Chart Start ISR ucontroller performing normal operation Y Interrupt Occurs? N Disable interrupt/ Save all current jobs Perform special Jobs (interrupt Service routine ) Interrupt Completed? Y Enable interrupt Resume current jobs N 32

33 Hardware Interrupt registers that involved in the interrupt operation, INTCON (0x0b) register and OPTION_REG (0x81) INTCON bit 3, known as RBIE, if set to 1, will inform PIC that RB4 to RB7 will be used as interrupt input group. They can not be select individually. When interrupt occurs, the interrupt flag, bit 1 of INTCON register is set. When this occur, the PIC microcontroller will not respond to any further interrupt. Enable occur INTCON (0x0b) GIE PEIE T0IE INTE RBIE T0IF INTF RBIF Bit 7 Default : x Bit 0 GIE - Global Interrupt Enable bit INTE RB0/INT External interrupt enable bit 33

34 Hardware Interrupt INTCON Register (0x0b) Global Interrupt Enable bit Enable Occur flag Bit 7 GIE PEIE T0IE INTE RBIE T0IF INTF RBIF Bit 0 For peripheral interrupt RB7 RB4 (all) as interrupt For timer-0 (TMR0) - interrupt For External interrupt RB0/INT Default : x 34

35 Hardware Interrupt INTCON Register (0x0b) The Peripheral interrupt enable bit ( PEIE ) have to work with another two sets of interrupt enable registers and flag for a specific features provided by PIC 16F877. they are : PIE1/ PIR1 for Parallel Slave Port Read/Write Interrupt (PSPIE) A/D Converter Interrupt (ADIE) USART Receive Interrupt ( RCIE) USART Transmit Interrupt (TXIE) Synchronous Serial Port Interrupt (SSPIE) CCP1 interrupt (CCP1IE) TMR2 to PR2 Match Interrupt (TMR2IE) TMR1 Overflow Interrupt (TMR1IE) 35

36 Hardware Interrupt INTCON Register (0x0b) PIE2/ PIR2 for Comparator Interrupt (CMIE) EEPROM Write Operation Interrupt (EEIE) Bus Collision Interrupt (BCLIE) CCP2 Interrupt (CCP2IE) The C language function library provided by vendor will take care of all these standard feature interrupt. We will focus on non-peripheral related interrupts. 36

37 Option register,option_reg, bit 6, INTEDG ( Interrupt Edge), when set, will cause the PIC to be interrupt on rising edge. When clear, the PIC will be interrupted on falling edge. The default interrupt setting is on rising edge. OPTION_REG (0x81) Hardware Interrupt RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 Bit 7 Default : Bit 0 INTEDG = 1 INTEDG = 0 INTEDG Interrupt Trigger Edge RB0/INT INTEDG = 1 INTEDG = 0 When PB4 to PB7 are used as interrupt, you cannot select individual pins on PORTB to serve as an interrupt input. It may be not so practical to use them as interrupt as you can not make use of these pin as I/O. 37

38 Option register,option_reg, bit 7, RBPU, when clear (=0), will turn on PORTB s internal pull-up (weak) as a high. The respective internal pull-up of the PORTB s pin will automatically turn-off when the PORTB pin is assign as output. OPTION_REG (0x81) Hardware Interrupt RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 Bit 7 5V Default : Bit 0 RB0 16f877 /RBPU = 0 Depending on circuit designed 38

39 Hardware Interrupt OPTION_REG Register (0x81) OPTION_REG register contains various control bits to configure the TMR0 prescaler / WDT postscaler, external interrupt(rb0/int), TMR0 and weak pull up on PORTB TMR0 Clock source TMR0 Source edge type Prescaler Bit 7 RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 Bit 0 PORTB pull-up Prescaler rate select RB0/INT interrupt edge type Prescaler assign to WDT or Timer0 Default :

40 OPTION_REG Register (0x81) Hardware Interrupt OPTION_REG (0x81) RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 Bit 7 Default : INTEDG Interrupt Trigger Edge Bit 0 INTEDG = 1 INTEDG = 0 40

41 Hardware Interrupt Some MikroC Programming statements Hardware Interrupt INTCON.F7=1; //enable global interrupt INTCON.F6=1; // enable all peripheral interrupt INTCON.F4=1; //set PB0 as the external interrupt OPTION_REG.F6=0; //interrupt at negative edge OPTION_REG.F7=0; //turnon RB0's internal pullup (weak) void interrupt() // funciton name of interrupt service routine { INTCON.F4=0; //disable RB0/INT ISR jobs INTCON.F1=0; //MUST HAVE -- clear interrupt flag INTCON.F4=1; //enable global interrupt } 41

42 Timer Interrupt 42

43 Timer Interrupt Timer0, TMR0, is a 8 bit binary up counter Count driven by external or internal clock source. TMR0 register stores the counter value which can be reset or preloaded with value Count increase with each input pulse until TMR0 overflow (from 0xFF to 0x00) Overflow triggered timer0 interrupt. The interrupt service routine will then be executed. 43

44 Timer Interrupt TMR0 register and prescaler relationship d Load TMR0=0 Prescale After 255 Pulse by timer0 d Interrupt Set RB1=~RB1 Load TMR0=0 For a 20MHZ crystal, d= ((# of tick) * 4 * Prescaler * 1000 )/(clock frequency) Case 1 : Prescaler = 1 d = 255 * 4 * 1 * 1000 / = 51 us Case 2 : Prescaler = 1:2 d = 255 * 4 * 2 * 1000 / = 102 us Case 3 : Prescaler = 1 d = 255 * 4 * 256 * 1000 / = 13.6ms Case 4 : Prescaler = 1 d = 95 * 4 * 256 * 1000 / = 4.86 ms 44

45 Multiple Interrupts 45

46 Multiple Interrupt When there is multiple interrupt requirement, the interrupt service function must check for what interrupt has happen and then execute the respective interrupt handler. E.g. RB0/INT or TMR0 handler The INTCON_REG provide the flag of the interrupt. INTCON_REG Bit 7 GIE PEIE T0IE INTE RBIE T0IF INTF RBIF Bit 0 46

47 Some MikroC Programming statements Timer Interrupt OPTION_REG = 0x18; // Prescale to WDT i.e TMR0 no prescale Multiple Interrupt void interrupt() { void rb0_interrupt(void) { jobs here } void tmr0_interrupt(void) { jobs here } Multiple Interrupt INTCON.F7 = 0; // disable further interrupt if ((INTCON & 0x02)==0x02){rb0_interrupt(); } // check for hardware interrupt if ((INTCON & 0x04)==0x04){tmr0_interrupt();} //check for timer0 interrupt INTCON=0xf0; //enable global and the required interrupt } 47

48 USART (Serial / RS232) Communication 48

49 USART/Com port/ Serial Port USART stands for Universal Synchronous Asynchronous Receiver Transmitter RS232, Serial Port, COM Port means the same thing Most of the desktop PC & engineering instrumentation still support serial port Its family standard RS422 can connect many devices together using 3 wires For PIC 16F877, USART is access through RC7 for Receive and RC6 for Transmit at TTL level ( hardware USART ) A RS232 line driver need to interface with RC7/RC6 to deliver the RS232 standard (i.e. high voltage level for long distance driving ) via a Max232 chip. Refer to any standard RS232 article for more detail description 49

50 Hardware USART RC6/RC7 provide signal at TTL level. MAX232 converts TTL high level to -13V and TTL low level to +13V which is good for data transmission on long wire. When No transmission, the signal is high, start bit is low, Stop bit is high 16F877A circuit RC6 RC7 MAX232 (1/2) RS232 v Start bit (0) Stop bit (1) D0 D1 D7 t 50

51 MikroC Statements MikroC support both software USART and hardware USART Software USART commands soft_uart_init ( port-number, rx-pin, tx-pin, baud rate, mode) mode = 0 : data not inverted e.g Soft_Uart_Init( PORTB, 0,1, 9600,0); PB0 rx, PB1-tx Soft_Uart_Read(&Rx_Error) e.g do { mychar = Soft_Uart_Init(&Rx_Error); } while (Rx_Error); error is normally 1 and become 0 when a byte is read from the port Soft_Uart_Write( character ); e.g. Soft_Uart_Write( A ); 51

52 MikroC Statements Hardware USART Commands Hardware USART can support higher baud rate Parameters need to setup for communication only baud rate is needed Baud rate : or others supported baud rate Rest of parameters are set, by the MikroC as follows : number of data bit : 8 bits number of stop bit : 1 Parity bit : N ( no parity ) e.g. USART_init(38400); 4 C-statements involve in serial communication Char USART_Write(char data) - 1 byte Char USART_Read(Void) Void USART_init( const long baudrate) Char USART_data_ready(void) 52

53 Read/Write Internal Data EEProm 53

54 Read/Write to Internal Data EEProm 16F877 has 256 byte of data memory and 8K of program memory that allow data and program remain in the device when power of switch off. The 6 SFR ( Special Function Register) use to support these functions are : EECON1, EECON2( Not a physical register ), EEDATH: EEDATA ( Holds 14 bits of data for Read/Write ) and EEADRH:EEADR ( holds the 13 bit address of the program memory location being access ). 54

55 Read/Write to Internal Data EEProm 55

56 MikroC Statements In MikroC, to write and read to internal EEProm, use the following statements : Unsigned short eeprom_read(unsigned short address); e.g. char read_data; read_data = eeprom_read(0x30); void eeprom_write(unsigned integer address, unsigned short data); e.g. eeprom_write(0x30, 0x11); 56

57 LCD Display 57

58 LCD Display The interface to LCD display is done through a set of data bit and control bits For the demo circuit, it uses 4 bits, RD7-RD3, for data instead of full 8 bits For MikroC, there is a predefine hardware interface as specified in the programming manual page 241, all LCD pins must connected to a single port. If you are using different hardware connection, normally the case, you can use the programming generator ( or you can write your own code ) provided by MikroC to generate the functions required to program the LCD based on your hardware connection (e.g. see below) ( called LCD4 Optimum Module by Warren Schroeder April 25, 2007 ) RD7-RD3 PIC 16F877A RA1 - RS RA2 - R/W RA3 - E LCD 58

59 LCD Display MiKroC s LCD Library s hardware requirement RB2-RB5 PIC 16F877A RB0 - RS LCD All pins must within a Port. Otherwise cannot use the library RB1 - E Lcd_Config (port-name, RS-pin, EN-pin, R/W-pin, D7-pin, D6-pin, D5-pin, D4-pin) R/W-pin is not use, should connect to ground (always write) e.g. Lcd_Config ( &PORTB, 0,1,2,3,4,5) Lcd_Init(Port-name ); Lcd_Init(&PORTB); Lcd_Out(row, column,text); Lcd_Out(1,2, MyTest ); Lcd_Out_Cp(text); Lcd_Out( Hello); output text from the Current Position Lcd_Chr ( row, column, character); Lcd_Chr(1,2, M ); Lcd_Chr_Cp(character); Lcd_Chr_Cp( M ); 59

60 LCD Display Program Generator Use when the LCD interface pins involve more than one PORT Select PIC type Define RS pin connection Define E pin connection Define Data pins ( 4 pins) connection In the software, set always write mode ( PORTA.F2 = 0 for /W ) For PICDEM2 60

61 LCD Application Constant Lcd_Cmd(command constant); Command constant LCD_CLEAR LCD_RETURN_HOME LCD_FIRST_ROW LCD_SECOND_ROW LCD_THIRD_ROW LCD_FORTH_ROW LCD_BLINK-CURSOR-ON LCD_TURN_ON LCD_TURN_OFF LCD_MOVE_CURSOR_LEFT LCD_MOVE_CURSOR_RIGHT LCD_SHIFT_LEFT LCD_SHIFT_RIGHT 61

62 Analog Measurement (Analog-to-Digital Converter) 62

63 Purpose of ADC To measure an analog voltage (e.g. sensor) input and convert to digital for the micro-controller to interpret and make decision Sensor/transducer produced very small analog voltage. In some cases it could be uv ( micro-volt ) and it needs an analog amplifier to amplify the signal to a measurable analog voltage. In order for a computer/microprocessor/micro-controller to interpret the analog signal, the analog signal need to convert to digital, for at least 8 bits or more. ( 10 bits for PIC16F877 ) If the analog signal is small, you have to use lower Vref in PIC16F877 ADC measurement in order to get more accurate digital measurement Sensor A ADC 63

64 ADC Block Diagram CS2-CS0 AN7 AN6 AN5 AN4 AN3 AN2 AN1 AN0 VDD Verf+ ADC Converter Reference Voltage PCFG<3:0> 10 bits Verf- VSS 64

65 ADC setup 3 Registers involve in the ADC Operation : TRISA, ADCON1 and ADCON0 Vref can be VDD or other value VDD V = (bits value) *(Vref / 1024) Vref 2 AN0 10 bits ADC converter 16F877 3 AN1 VSS VDD When measure small voltage, it is more accurate to supply own Vref Due to VDD may vary, it is more accurate to use a Vref instead of using VDD as Vref VSS Symbol Hardware port AN7 RE2 AN6 AN5 AN4 AN3 AN2 AN1 AN0 RE1 RE0 RA5 RA3 RA2 RA1 RA0 65

66 What need to be set for measurement? How many analog ports to use and Vref to use : PCFG3-PCFG0 ANCON1 Set the respective hardware ports to be input for ADC operation TRISA and/or TRISE Define measurement data to be read is Right justify or Left justify ADFM bit in ANCON1 Select AD conversion clock : ADCS2 in ANCON1 and ADCS1 & ADCS0 in ANCON0( A/D control register 0) For each channel to be measured, select the channel number and set ADC to be ON : CHS2-CHS0 bits and ADON bit in ANCON0 For each channel selected, set the GO//Done bit in ANCON0 to 1 and start ADC measurement. When ADC measurement completed, the GO//Done bit will be set to 0. 10us Conversion time should be sufficient ( refer to data sheet for detail calculation) in 66

67 Analog to Digital conversion setup When use AN0 & AN1 as input, from the configuration table, select PCFG3 to PCFG0 to be 0100 TRISA = 0x0b; PortA0, PortA1 & PortA3 are inputs, PortA2, PortA4 PortA7 are outputs ADCON1 AN0,AN1,AN3 analog, AN2, AN4 AN7 all digital VREF+ = VDD, VREF = Vss ( internal ) ADFM ADCS2 - - PCFG3 PCFG2 PCFG1 PCFG0 ADCS1 GO/ ADCS0 CHS2 CHS1 CHS0 - ADON ADCON0 /Done 1 Enable A/D measurement Select AD conversion clock 110 = FOSC/64 for 20MHZ crystal OK Select channel 0 = 1 Start A/D conversion =0 A/D conversion completed Right justify ADRESH,ADRESL = xx,xxxxxxxx 67

68 ANCON1 Configuration The configuration table for ANCON1 is shown below : only the first 4 bits is used 68

69 ANCON1 Configuration When ports are selected for analog input, the conversion clock rate ( use in conjunction with ADCON0 ) and the ADC read result format are set according to the following format : 69

70 ADCON0 Configuration ADCON1 ADCON0 70

71 Important ADC Program ADC Measurement Steps /* Read AN1 port, use FOSC/64 */ ADCON0= 0x89; // importnant : switch port first, don't measure delay_ms(100); // important : for it to stabilize ADCON0 = 0x8d; // AN1 read delay_ms(100); while( ADCON0 & 0x04){} // check conversion completed? datal= ADRESL; // read result datah=adresh; write_adc_result(datah,datal); // output result to display 71

72 Pulse Width Modulation 72

73 PWM stands for Pulse Width Modulation PWM is basically sending a pulse with various duty cycle so the receiver device, which is a PWM operated, can perform a specific function. Example : Servo motor, beeper, flash light etc w Pulse Width Modulation T Duty cycle = W / T * 100% When the pulse width is longer, the flashing LED will be brighter or the beeper will have different sound frequency. For PWM servo motor, the motor will turn in different direction. PWM pulse can be generated by pulse a output pin the Hi & Lo with time delay to generate the pulse or can be done by a specific PWM output pins For 16F877, it has two pins RC1 ( CCP2 ) and RC2 (CCP1) that response to generate the PWM pulses 73

74 Pulse Width Modulation In MiKroC the statements use to generate the PWM are follows : void PWM_Init(long freq); - initialize PWM frequency void PWM_Change_Duty( char duty_ratio ); - set duty cycle where duty_ratio ranges from 0 to 255 duty cycle = ( % * 255 ) / % duty cycle, duty_ratio = % duty cycle, duty_ratio = 255 void PWM_Start (void) ; - start PWM void PWM_Stop (void); - stop PWM For 16F877 chip, there is two PWMs, you can use PWM1 and PWM2 syntax to generate two different PWM pulse 74

75 Pulse Width Modulation In MiKroC the statements example RC1 ( CCP2- PWM2 ) RC2 ( CCP1- PWM1 ) PWM1_Init(5000); PWM2_Init(5000); PWM1_Change_Duty(127); // 50% duty cycle PWM2_change_Duty(20); // 7.84% duty cycle PWM1_start(); PWM2_start(); // determine PWM to start while( PORTA.F4 == 0){} // when button release, stop PWM1_stop(); PWM2_stop(); 75

76 PWM for Servo Motor Control For motor control, pulses with various duty cycle are used for DC Motor speed control and servo motor position control For servo motor position control, different pulse width will cause the motor to rotate at different angle. The general guide line for servo motor rotation are as follows : 1 ms 1.5 ms center 2.0 ms right Left 18 ms 18 ms 18 ms 76

77 IIC Serial Communication 77

78 IIC Serial Communication System level serial data communication method Need two signal lines : data (SDA) and clock (SCL) Allow a master device control up to 1023 other devices Signal lines have 5V pull up Each data bit is accompany by a clock pulse Clock speed is programmed by preload the baud rate generator up to 1MHZ 5V 4.7K 4.7K Master Slave Slave start acknowledgement SDA SCL SDA SCL 78

79 IIC Serial Communication Interface to a 256K EEProm 5V 16F877A circuit RC4 RC3 4.7K SDA SCL K 5V 8 SDA SCL A0 A1 A2 24LC K IIC Serial EEProm 4 79

80 IIC Serial Communication In MiKroC the statements use in IIC communication are follows : void I2C_Init(long clock); char I2C_Start(void); void I2C_repeated_Start(void); char I2C_Is_Idle(void); char I2C_Rd(char ack); ack=0 means no acknowledge char I2C_Wr(char data); void I2C_Stop(void); 80

81 IIC Serial Communication Write Byte I2C_Start(); I2C_Wr(0xA0); //control byte for write I2C_Wr(addrhighbyte); //address to write - high byte I2C_Wr(addrlowbyte); //address to write - low byte I2C_Wr(data); //data I2C_Stop(); 81

82 IIC Serial Communication Random read address I2C_Start(); I2C_Wr(0xA0); //control byte for write I2C_Wr(addrhighbyte); //address to read high - byte I2C_Wr(addrlowbyte); //address to read low - byte I2C_Repeated_Start(); I2C_Wr(0xA1); //control byte for read data = I2C_Rd(0u); I2C_Stop(); 82

83 Read/Write External EEprom 93LC46 using I/O Ports QL200 PIC Development Board ( China ) 83

84 External EEprom using I/O Functional block diagram Parameters: data bits 1 stop bit N parity 16F877A circuit RC2 RC3 RC5 RC4 CS CLK DI DO Memory locations to write/read are : 0x01, 0x02,0x3f,0x18,0x2a VCC NC NC VSS 93LC46 84

85 External EEprom using I/O 93LC46 is a 1024-bit non-volatile, serial EEProm. 6 bit of address and 16 bit of data > total = 64 x 16 = 1024 bit 4 signal pins : CS chip select, SK clock pin, DI data in, DO-data out. Provide write enable or disable function to protect the data All functions such as read, write, write enable etc required a predefine function header before the address and/or data see datasheet for detail Write data to a address provide 6 bits of address follow by 16 bits of data to the DI pin Read data at address provide 6 bit of address and read data from the DO pin 4 important functions : Write enable, write disable, read and write 85

86 Write enable External EEprom using I/O Pin Layout Write disable 86

87 External EEprom using I/O Write data operation must have 87

88 External EEprom using I/O Read data operation 88

89 External EEprom using I/O Program Methodolgy DI1, DI0 input data bit high, low CS1, CS0 chip select bit high, low Clk - generate 1 clock pulse void DI1(void) { PORTC.F5=1; delay_us(200); } void DI0(void) { PORTC.F5=0; delay_us(200); } void clk (void) { PORTC.F3 = 0; delay_us(100); PORTC.F3 = 1; delay_us(200); PORTC.F3 = 0; delay_us(100); } void CS1(void) { PORTC.F2=1; delay_us(200); } void CS0(void) { PORTC.F2=0; delay_us(200); } 89

90 Real Time Clock QL200 PIC Development Board ( China ) 90

91 Real Time Clock (RTC) Your will learn : Hardware Function of Real Time Clock Software How to program the Real Time Clock : Write Date and Time Read Date and Time Protect / Un-Protect RTC for writing 91

92 Real Time Clock Project Program the date and time with the following information : Date : 23 /07/08 Time : 14:50:00 Read back the Date and time every seconds and display on LCD and on serial port Functional block diagram Parameters: 16F877A circuit RB0 RB4 RB5 CLK I/O RST data bits 1 stop bit N parity Date:23/07/08 Time:14:59:20 RTC DS1302 LCD Display 92

93 Real Time Clock (RTC) RTC counts Hour:Minute:Second and Day/Month/Year with other features such as 12/24 hour, AM/PM option RTC used here is DS1302, 8 pins IC(3 signal wires), 2V to 5.5V operation RTC chip need to work with an crystal oscillator circuit (32.768kHz) RTC also provide serial interface for data I/O ( read/write ) and clock Two power supplies input for RTC, One for battery and one for normal DC power Date and Time is set through the programming to a set of predefine memory location with the desire Date and Time value in human understandable value. These value are written directly to the memory location in HEX format without conversion to hex value. e.g. 14 hr, 20 min, 59 sec write as 0x14, 0x20 and 0x59 93

94 Real Time Clock (RTC) Memory locations for writing and reading of Date and Time Max = 5,need 3 bit Max = 9, need 4 bit Location for read Location for write 94

95 Digital to Analog Converter TLC5615C QL200 PIC Development Board ( China ) 95

96 Digital to Analog Converter TLC5615C 10 bit CMOS voltage output DAC 3 wire interface High impedance reference input 8 pin package 96

97 Digital to Analog Converter To program the TLC5615C, need to send 16 bits of serial data into the shift register of TLC5615C Only 10 bits are for voltage programming : Vout = 2 * (V ) * refin V 10 bits 1024 VH High byte H1 H0 VL Low byte L7 L6 L5 L4 L3 L2 L1 L0 Vout If Vrefin = 2.0v, VH = 0x02 VL= 0xab; Vout = 2 * (2) * V ( ) 1024 = 4 * (683/1024) = 2.67 v 97

98 Digital to Analog Converter The bit pattern send to the TLC5615C serially are : 0,0,L0,L1,L2,L3,L4,L5,L6,L7,H0,H1,D,D,D,D where D dummy bit, 0 - zero Every data bit will send to the TLC5615C when the clock is at high transition. /CS must be low before the first clock take place and must be high after the last 16 th bit is clocked. 98

99 Digital to Analog Converter 99

100 Digital to Analog Converter Project Functional block diagram REF In = VDD RC2 - CS RC3 - SCLK RC5 - DIN TLC 5615 D/A VOUT PIC 16F877A RB0 Lowest 8 DAC bit to PORTB display RB7 RA0 To advance the DAC output to different value 100

101 Digital to Analog Converter Programming sequence are : /CS = 0 send in 4 clock pulse ( Din don t care dummy ) Reverse the bit sequence for High byte and low byte for each of the 10 bit ( high or low ), send in the clock to clock in the bit send in two clock with DIN= 0 /CS = 1 101

102 Some Useful Functions 102

103 Useful functions function Lo (number) Hi (number) Higher (number) Highest (number) Description Return ( bit 7-0 ) of a number Return ( bit 15-8 ) of a number Return ( bit )of a number Return (bit ) of a number Delay_us (number) Delay_ms (number) Vdelay_ms ( variable) Software delay in microseconds Software delay in milliseconds Software delay using program variable EEProm_Write (address, data) EEProm_read (address) Write the eeprom address with the data Read the eeprom address 103

104 Useful functions function Isalnum Isalpha Isntrl Isdigit Islower Isprint Isupper Toupper Tolower Description Return a 1 if is alphanumeric ( a-z. A-Z, 0-9) Return a 1 if it is a-z, A-Z Return a 1 if is control character ( decimal 0-31 and 127) Return a 1 if is 0-9 Return a 1 if is lowercase Return a 1 if is is printable ( decimal ) Return a 1 if is is uppercase Convert a character to uppercase Concert a character to lowercase 104

105 Useful functions function Abs Atof Atoi Atol Max Min Rand Srand Xtoi Description Return the absolute value Convert ASCII character to floating point number Convert ASCII character to integer Convert ASCII to long integer Return the greater of two integers Return the lesser of two integers Return a random number between 0 and srand() must be called first Generate a seed for function rand to call Convert input string consisting of hex digits into integer 105

106 Useful functions function Strcat, strncat Strchar, strpbrk Strcmp, strncmp Strcpy, strncpy Strlen Description Append two strings Locate the first occurrence of a character in a string Compare two strings Copy one string into another one Return the length of a string 106

107 Useful functions function ByteToStr shorttostr WordToStr IntToStr LongToStr FloatToStr Bcd2Dec Dec2Bcd Description Convert a byte into string Convert a short into string Convert an unsigned word into string Convert an integer into string Convert a long into string Convert a float into string Convert a BCD number into decimal Convert a decimal number into BCD 107

108 108

109 109

ELCT 912: Advanced Embedded Systems

ELCT 912: Advanced Embedded Systems ELCT 912: Advanced Embedded Systems Lecture 5: PIC Peripherals on Chip Dr. Mohamed Abd El Ghany, Department of Electronics and Electrical Engineering The PIC Family: Peripherals Different PICs have different

More information

Building an Analog Communications System

Building an Analog Communications System Building an Analog Communications System Communicate between two PICs with analog signals. Analog signals have continous range. Analog signals must be discretized. Digital signal converted to analog Digital

More information

Embedded Systems. Interfacing PIC with external devices Analog to digital Converter. Eng. Anis Nazer Second Semester

Embedded Systems. Interfacing PIC with external devices Analog to digital Converter. Eng. Anis Nazer Second Semester Embedded Systems Interfacing PIC with external devices Analog to digital Converter Eng. Anis Nazer Second Semester 2016-2017 What is the time? What is the time? Definition Analog: can take any value Digital:

More information

MICROPROCESSORS A (17.383) Fall Lecture Outline

MICROPROCESSORS A (17.383) Fall Lecture Outline MICROPROCESSORS A (17.383) Fall 2010 Lecture Outline Class # 07 October 26, 2010 Dohn Bowden 1 Today s Lecture Syllabus review Microcontroller Hardware and/or Interface Finish Analog to Digital Conversion

More information

PIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232

PIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232 PIC Functionality General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232 General I/O Logic Output light LEDs Trigger solenoids Transfer data Logic Input Monitor

More information

Interfacing to Analog World Sensor Interfacing

Interfacing to Analog World Sensor Interfacing Interfacing to Analog World Sensor Interfacing Introduction to Analog to digital Conversion Why Analog to Digital? Basics of A/D Conversion. A/D converter inside PIC16F887 Related Problems Prepared By-

More information

Serial Servo Controller

Serial Servo Controller Document : Datasheet Model # : ROB - 1185 Date : 16-Mar -07 Serial Servo Controller - USART/I 2 C with ADC Rhydo Technologies (P) Ltd. (An ISO 9001:2008 Certified R&D Company) Golden Plaza, Chitoor Road,

More information

Controlling DC Brush Motor using MD10B or MD30B. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

Controlling DC Brush Motor using MD10B or MD30B. Version 1.2. Aug Cytron Technologies Sdn. Bhd. PR10 Controlling DC Brush Motor using MD10B or MD30B Version 1.2 Aug 2008 Cytron Technologies Sdn. Bhd. Information contained in this publication regarding device applications and the like is intended

More information

TKT-3500 Microcontroller systems

TKT-3500 Microcontroller systems TKT-3500 Microcontroller systems Lec 4 Timers and other peripherals, pulse-width modulation Ville Kaseva Department of Computer Systems Tampere University of Technology Fall 2010 Sources Original slides

More information

Arduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett

Arduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett Arduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett Anatomy of a Program Programs written for a microcontroller have a fairly repeatable format. Slight variations exist

More information

MD04-24Volt 20Amp H Bridge Motor Drive

MD04-24Volt 20Amp H Bridge Motor Drive MD04-24Volt 20Amp H Bridge Motor Drive Overview The MD04 is a medium power motor driver, designed to supply power beyond that of any of the low power single chip H-Bridges that exist. Main features are

More information

8-bit Microcontroller with 512/1024 Bytes In-System Programmable Flash. ATtiny4/5/9/10

8-bit Microcontroller with 512/1024 Bytes In-System Programmable Flash. ATtiny4/5/9/10 Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 54 Powerful Instructions Most Single Clock Cycle Execution 16 x 8 General Purpose Working Registers Fully Static

More information

Introduction to Using the PIC16F877 Justin Rice IMDL Spring 2002

Introduction to Using the PIC16F877 Justin Rice IMDL Spring 2002 Introduction to Using the PIC16F877 Justin Rice IMDL Spring 2002 Basic Specs: - 30 pins capable of digital I/O - 8 that can be analog inputs - 2 capable of PWM - 8K of nonvolatile FLASH memory - 386 bytes

More information

PIC Analog Voltage to PWM Duty Cycle

PIC Analog Voltage to PWM Duty Cycle Name Lab Section PIC Analog Voltage to PWM Duty Cycle Lab 5 Introduction: In this lab you will convert an analog voltage into a pulse width modulation (PWM) duty cycle. The source of the analog voltage

More information

PID MOTOR CONTROLLER. Version 1.0. October Cytron Technologies Sdn. Bhd.

PID MOTOR CONTROLLER. Version 1.0. October Cytron Technologies Sdn. Bhd. PID MOTOR CONTROLLER PR24 Version 1.0 October 2009 Cytron Technologies Sdn. Bhd. Information contained in this publication regarding device applications and the like is intended through suggestion only

More information

EIE/ENE 334 Microprocessors

EIE/ENE 334 Microprocessors EIE/ENE 334 Microprocessors Lecture 13: NuMicro NUC140 (cont.) Week #13 : Dejwoot KHAWPARISUTH Adapted from http://webstaff.kmutt.ac.th/~dejwoot.kha/ NuMicro NUC140: Technical Ref. Page 2 Week #13 NuMicro

More information

Distributed by: www.jameco.com 1-800-831-4242 The content and copyrights of the attached material are the property of its owner. M PIC16F87X 28/40-pin 8-Bit CMOS FLASH Microcontrollers Microcontroller

More information

Roland Kammerer. 13. October 2010

Roland Kammerer. 13. October 2010 Peripherals Roland Institute of Computer Engineering Vienna University of Technology 13. October 2010 Overview 1. Analog/Digital Converter (ADC) 2. Pulse Width Modulation (PWM) 3. Serial Peripheral Interface

More information

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny20

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny20 Features High Performance, Low Power AVR 8-bit Microcontroller Advanced RISC Architecture 112 Powerful Instructions Most Single Clock Cycle Execution 16 x 8 General Purpose Working Registers Fully Static

More information

EE 308 Lab Spring 2009

EE 308 Lab Spring 2009 9S12 Subsystems: Pulse Width Modulation, A/D Converter, and Synchronous Serial Interface In this sequence of three labs you will learn to use three of the MC9S12's hardware subsystems. WEEK 1 Pulse Width

More information

Standard single-purpose processors: Peripherals

Standard single-purpose processors: Peripherals 3-1 Chapter 3 Standard single-purpose processors: Peripherals 3.1 Introduction A single-purpose processor is a digital system intended to solve a specific computation task. The processor may be a standard

More information

8-bit Microcontroller with 8K Bytes In-System Programmable Flash. ATmega8535 ATmega8535L

8-bit Microcontroller with 8K Bytes In-System Programmable Flash. ATmega8535 ATmega8535L Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 130 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

32-bit ARM Cortex-M0, Cortex-M3 and Cortex-M4F microcontrollers

32-bit ARM Cortex-M0, Cortex-M3 and Cortex-M4F microcontrollers -bit ARM Cortex-, Cortex- and Cortex-MF microcontrollers Energy, gas, water and smart metering Alarm and security systems Health and fitness applications Industrial and home automation Smart accessories

More information

PIC ADC to PWM and Mosfet Low-Side Driver

PIC ADC to PWM and Mosfet Low-Side Driver Name Lab Section PIC ADC to PWM and Mosfet Low-Side Driver Lab 6 Introduction: In this lab you will convert an analog voltage into a pulse width modulation (PWM) duty cycle. The source of the analog voltage

More information

Unit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION

Unit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION M i c r o p r o c e s s o r s a n d M i c r o c o n t r o l l e r s P a g e 1 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION Microcomputer system design requires

More information

PIC16F Pin, 8-Bit CMOS FLASH Microcontroller. Devices Included in this Data Sheet: Pin Diagram. Microcontroller Core Features:

PIC16F Pin, 8-Bit CMOS FLASH Microcontroller. Devices Included in this Data Sheet: Pin Diagram. Microcontroller Core Features: 28-Pin, 8-Bit CMOS FLASH Microcontroller Devices Included in this Data Sheet: PIC16F872 Microcontroller Core Features: High-performance RISC CPU Only 35 single word instructions to learn All single cycle

More information

UART2PPM. User s Guide. Version 2.04 dated 02/20/16. Gregor Schlechtriem

UART2PPM. User s Guide. Version 2.04 dated 02/20/16. Gregor Schlechtriem UART2PPM User s Guide Version 2.04 dated 02/20/16 Gregor Schlechtriem www.pikoder.com UART2PPM User s Guide Content Overview 3 PCC PiKoder Control Center 5 Getting started... 5 Real-time Control... 7 minissc

More information

The ST7528 is a driver & controller LSI for 16-level gray scale graphic dot-matrix liquid crystal display systems. It contains

The ST7528 is a driver & controller LSI for 16-level gray scale graphic dot-matrix liquid crystal display systems. It contains Sitronix ST ST7528 16 Gray Scale Dot Matrix LCD Controller/Driver INTRODUCTION The ST7528 is a driver & controller LSI for 16-level gray scale graphic dot-matrix liquid crystal display systems. It contains

More information

TMS320F241 DSP Boards for Power-electronics Applications

TMS320F241 DSP Boards for Power-electronics Applications TMS320F241 DSP Boards for Power-electronics Applications Kittiphan Techakittiroj, Narong Aphiratsakun, Wuttikorn Threevithayanon and Soemoe Nyun Faculty of Engineering, Assumption University Bangkok, Thailand

More information

PIC16F716 Data Sheet. 8-bit Flash-based Microcontroller with A/D Converter and Enhanced Capture/Compare/PWM

PIC16F716 Data Sheet. 8-bit Flash-based Microcontroller with A/D Converter and Enhanced Capture/Compare/PWM Data Sheet 8-bit Flash-based Microcontroller with A/D Converter and Enhanced Capture/Compare/PWM 2003 Microchip Technology Inc. Preliminary DS41206A Note the following details of the code protection feature

More information

Imaging serial interface ROM

Imaging serial interface ROM Page 1 of 6 ( 3 of 32 ) United States Patent Application 20070024904 Kind Code A1 Baer; Richard L. ; et al. February 1, 2007 Imaging serial interface ROM Abstract Imaging serial interface ROM (ISIROM).

More information

Servo click. PID: MIKROE 3133 Weight: 32 g

Servo click. PID: MIKROE 3133 Weight: 32 g Servo click PID: MIKROE 3133 Weight: 32 g Servo click is a 16-channel PWM servo driver with the voltage sensing circuitry. It can be used to simultaneously control 16 servo motors, each with its own programmable

More information

3.3V regulator. JA H-bridge. Doc: page 1 of 7

3.3V regulator. JA H-bridge. Doc: page 1 of 7 Cerebot Reference Manual Revision: February 9, 2009 Note: This document applies to REV B-E of the board. www.digilentinc.com 215 E Main Suite D Pullman, WA 99163 (509) 334 6306 Voice and Fax Overview The

More information

DS1307ZN. 64 X 8 Serial Real Time Clock

DS1307ZN. 64 X 8 Serial Real Time Clock 64 X 8 Serial Real Time Clock www.dalsemi.com FEATURES Real time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation valid up to 2100 56

More information

EE 314 Spring 2003 Microprocessor Systems

EE 314 Spring 2003 Microprocessor Systems EE 314 Spring 2003 Microprocessor Systems Laboratory Project #9 Closed Loop Control Overview and Introduction This project will bring together several pieces of software and draw on knowledge gained in

More information

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ θωερτψυιοπασδφγηϕκλζξχϖβνµθωερτψ υιοπασδφγηϕκλζξχϖβνµθωερτψυιοπασδ φγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκλζ ξχϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµ EE 331 Design Project Final Report θωερτψυιοπασδφγηϕκλζξχϖβνµθωερτψ

More information

GCE A level 1145/01 ELECTRONICS ET5. P.M. THURSDAY, 31 May hours. Centre Number. Candidate Number. Surname. Other Names

GCE A level 1145/01 ELECTRONICS ET5. P.M. THURSDAY, 31 May hours. Centre Number. Candidate Number. Surname. Other Names Surname Other Names Centre Number 0 Candidate Number GCE A level 1145/01 ELECTRONICS ET5 P.M. THURSDAY, 31 May 2012 1 1 2 hours For s use Question Maximum Mark Mark Awarded 1. 6 2. 9 3. 8 4. 6 1145 010001

More information

DS1307/DS X 8 Serial Real Time Clock

DS1307/DS X 8 Serial Real Time Clock DS1307/DS1308 64 X 8 Serial Real Time Clock www.dalsemi.com FEATURES Real time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation valid

More information

EXAMINATION PAPER EMBEDDED SYSTEMS 6EJ005 UNIVERSITY OF DERBY. School of Computing and Technology DATE: SUMMER 2003 TIME ALLOWED: 2 HOURS

EXAMINATION PAPER EMBEDDED SYSTEMS 6EJ005 UNIVERSITY OF DERBY. School of Computing and Technology DATE: SUMMER 2003 TIME ALLOWED: 2 HOURS BSc/BSc (HONS) MUSIC TECHNOLOGY AND AUDIO SYSTEM DESIGN BSc/BSc (HONS) LIVE PERFORMANCE TECHNOLOGY BSc/BSc (HONS) ELECTRICAL AND ELECTRONIC ENGINEERING DATE: SUMMER 2003 TIME ALLOWED: 2 HOURS Instructions

More information

Four Quadrant Speed Control of DC Motor with the Help of AT89S52 Microcontroller

Four Quadrant Speed Control of DC Motor with the Help of AT89S52 Microcontroller Four Quadrant Speed Control of DC Motor with the Help of AT89S52 Microcontroller Rahul Baranwal 1, Omama Aftab 2, Mrs. Deepti Ojha 3 1,2, B.Tech Final Year (Electronics and Communication Engineering),

More information

PIC16F716 Data Sheet. 8-bit Flash-based Microcontroller with A/D Converter and Enhanced Capture/Compare/PWM

PIC16F716 Data Sheet. 8-bit Flash-based Microcontroller with A/D Converter and Enhanced Capture/Compare/PWM Data Sheet 8-bit Flash-based Microcontroller with A/D Converter and Enhanced Capture/Compare/PWM 2003 Microchip Technology Inc. Preliminary DS41206A Note the following details of the code protection feature

More information

Programming and Interfacing

Programming and Interfacing AtmelAVR Microcontroller Primer: Programming and Interfacing Second Edition f^r**t>*-**n*c contents Preface xv AtmelAVRArchitecture Overview 1 1.1 ATmegal64 Architecture Overview 1 1.1.1 Reduced Instruction

More information

Stensat Transmitter Module

Stensat Transmitter Module Stensat Transmitter Module Stensat Group LLC Introduction The Stensat Transmitter Module is an RF subsystem designed for applications where a low-cost low-power radio link is required. The Transmitter

More information

8-bit with 8K Bytes In-System Programmable Flash. ATmega8 ATmega8L. Preliminary

8-bit with 8K Bytes In-System Programmable Flash. ATmega8 ATmega8L. Preliminary Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 130 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

ZKit-51-RD2, 8051 Development Kit

ZKit-51-RD2, 8051 Development Kit ZKit-51-RD2, 8051 Development Kit User Manual 1.1, June 2011 This work is licensed under the Creative Commons Attribution-Share Alike 2.5 India License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.5/in/

More information

Distributed by: www.jameco.com 1-800-831-4242 The content and copyrights of the attached material are the property of its owner. 28/40-Pin 8-Bit CMOS FLASH Microcontrollers Devices Included in this Data

More information

8-bit Microcontroller with 1K Bytes In-System Programmable Flash. ATtiny13A

8-bit Microcontroller with 1K Bytes In-System Programmable Flash. ATtiny13A Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

Low Power with Long Range RF Module DATASHEET Description

Low Power with Long Range RF Module DATASHEET Description Wireless-Tag WT-900M Low Power with Long Range RF Module DATASHEET Description WT-900M is a highly integrated low-power half-'duplex RF transceiver module embedding high-speed low-power MCU and high-performance

More information

GCE A level 1145/01 ELECTRONICS ET5

GCE A level 1145/01 ELECTRONICS ET5 Surname Other Names Centre Number 2 Candidate Number GCE A level 1145/01 ELECTRONICS ET5 A.M. WEDNESDAY, 12 June 2013 1½ hours ADDITIONAL MATERIALS In addition to this examination paper, you will need

More information

IZ602 LCD DRIVER Main features: Table 1 Pad description Pad No Pad Name Function

IZ602 LCD DRIVER Main features: Table 1 Pad description Pad No Pad Name Function LCD DRIVER The IZ602 is universal LCD controller designed to drive LCD with image element up to 128 (32x4). Instruction set makes IZ602 universal and suitable for applications with different types of displays.

More information

8-bit with 8K Bytes In-System Programmable Flash. ATmega8A

8-bit with 8K Bytes In-System Programmable Flash. ATmega8A Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 3 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

GC221-SO16IP. 8-bit Turbo Microcontroller

GC221-SO16IP. 8-bit Turbo Microcontroller Total Solution of MCU GC221-SO16IP 8-bit Turbo Microcontroller CORERIVER Semiconductor reserves the right to make corrections, modifications, enhancements, improvements, and other changes to its products

More information

8-bit Atmel tinyavr Microcontroller with 16K Bytes In-System Programmable Flash. ATtiny1634

8-bit Atmel tinyavr Microcontroller with 16K Bytes In-System Programmable Flash. ATtiny1634 8-bit Atmel tinyavr Microcontroller with 16K Bytes In-System Programmable Flash Features High Performance, Low Power AVR 8-bit Microcontroller Advanced RISC Architecture 125 Powerful Instructions Most

More information

I2C Demonstration Board I 2 C-bus Protocol

I2C Demonstration Board I 2 C-bus Protocol I2C 2005-1 Demonstration Board I 2 C-bus Protocol Oct, 2006 I 2 C Introduction I ² C-bus = Inter-Integrated Circuit bus Bus developed by Philips in the early 80s Simple bi-directional 2-wire bus: serial

More information

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATtiny1634

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATtiny1634 Features High Performance, Low Power AVR 8-bit Microcontroller Advanced RISC Architecture 125 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

Package Type. 6800, 8080, 4-Line, 3-Line interface (without IIC interface)

Package Type. 6800, 8080, 4-Line, 3-Line interface (without IIC interface) Sitronix INTRODUCTION ST ST7541 4 Gray Scale Dot Matrix LCD Controller/Driver ST7541 is a driver & controller LSI for 4-level gray scale graphic dot-matrix liquid crystal display systems. This chip can

More information

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny2313/V. Preliminary

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny2313/V. Preliminary Features Utilizes the AVR RISC Architecture AVR High-performance and Low-power RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully

More information

Counter/Timers in the Mega8

Counter/Timers in the Mega8 Counter/Timers in the Mega8 The mega8 incorporates three counter/timer devices. These can: Be used to count the number of events that have occurred (either external or internal) Act as a clock Trigger

More information

PIC16C712/716 Data Sheet

PIC16C712/716 Data Sheet Data Sheet 8-Bit CMOS Microcontrollers with A/D Converter and Capture/Compare/PWM 2005 Microchip Technology Inc. DS41106B Note the following details of the code protection feature on Microchip devices:

More information

8-bit with 8K Bytes In-System Programmable Flash. ATmega8* ATmega8L*

8-bit with 8K Bytes In-System Programmable Flash. ATmega8* ATmega8L* Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 130 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny2313/V. Preliminary

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny2313/V. Preliminary Features Utilizes the AVR RISC Architecture AVR High-performance and Low-power RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully

More information

Figure 1: One Possible Advanced Control System

Figure 1: One Possible Advanced Control System Control and Navigation 3 Cornerstone Electronics Technology and Robotics III (Notes primarily from Underwater Robotics Science Design and Fabrication, an excellent book for the design, fabrication, and

More information

BV4112. Serial Micro stepping Motor Controller. Product specification. Dec V0.a. ByVac Page 1 of 18

BV4112. Serial Micro stepping Motor Controller. Product specification. Dec V0.a. ByVac Page 1 of 18 Product specification Dec. 2012 V0.a ByVac Page 1 of 18 SV3 Relay Controller BV4111 Contents 1. Introduction...4 2. Features...4 3. Electrical interface...4 3.1. Serial interface...4 3.2. Motor Connector...4

More information

8-bit Microcontroller with 4K Bytes In-System Programmable Flash and Boost Converter. ATtiny43U. Preliminary

8-bit Microcontroller with 4K Bytes In-System Programmable Flash and Boost Converter. ATtiny43U. Preliminary Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

ATtiny25/45/85 Automotive

ATtiny25/45/85 Automotive ATtiny25/45/85 Automotive 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash DATASHEET Features High performance, low power AVR 8-bit microcontroller Advanced RISC architecture 120

More information

EXPERIMENT 6: Advanced I/O Programming

EXPERIMENT 6: Advanced I/O Programming EXPERIMENT 6: Advanced I/O Programming Objectives: To familiarize students with DC Motor control and Stepper Motor Interfacing. To utilize MikroC and MPLAB for Input Output Interfacing and motor control.

More information

The ST7588T is a driver & controller LSI for graphic dot-matrix liquid crystal display systems. It contains 132 segment and 80

The ST7588T is a driver & controller LSI for graphic dot-matrix liquid crystal display systems. It contains 132 segment and 80 ST Sitronix ST7588T 81 x 132 Dot Matrix LCD Controller/Driver INTRODUCTION The ST7588T is a driver & controller LSI for graphic dot-matrix liquid crystal display systems. It contains 132 segment and 80

More information

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATmega16 ATmega16L. Preliminary

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATmega16 ATmega16L. Preliminary Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

HD44102D. (Dot Matrix Liquid Crystal Graphic Display Column Driver) Features. Description. Ordering Information

HD44102D. (Dot Matrix Liquid Crystal Graphic Display Column Driver) Features. Description. Ordering Information HD442 (Dot Matrix Liquid Crystal Graphic Display Column Driver) Description The HD442 is a column (segment) driver for dot matrix liquid crystal graphic display systems, storing the display data transferred

More information

Trademarks & Copyright

Trademarks & Copyright Smart Peripheral Controller Neo DC Motor 1.2A Trademarks & Copyright AT, IBM, and PC are trademarks of International Business Machines Corp. Pentium is a registered trademark of Intel Corporation. Windows

More information

High Performance, Low Power Atmel AVR 8-bit Microcontroller Advanced RISC Architecture. Non-volatile Program and Data Memories. Peripheral Features

High Performance, Low Power Atmel AVR 8-bit Microcontroller Advanced RISC Architecture. Non-volatile Program and Data Memories. Peripheral Features ATtiny828 8-bit AVR Microcontroller with 8K Bytes In-System Programmable Flash DATASHEET Features High Performance, Low Power Atmel AVR 8-bit Microcontroller Advanced RISC Architecture 123 Powerful Instructions

More information

DS1307ZN. 64 X 8 Serial Real Time Clock PIN ASSIGNMENT FEATURES

DS1307ZN. 64 X 8 Serial Real Time Clock PIN ASSIGNMENT FEATURES DS1307 64 8 Serial Real Time Clock FEATURES Real time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation valid up to 2100 56 byte nonvolatile

More information

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny25/V ATtiny45/V ATtiny85/V. Preliminary

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny25/V ATtiny45/V ATtiny85/V. Preliminary Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

8-bit Microcontroller with 32K Bytes In-System Programmable Flash. ATmega32 ATmega32L

8-bit Microcontroller with 32K Bytes In-System Programmable Flash. ATmega32 ATmega32L Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

GCE A level 1145/01 ELECTRONICS ET5

GCE A level 1145/01 ELECTRONICS ET5 Surname Centre Number Candidate Number Other Names 2 GCE A level 1145/01 ELECTRONICS ET5 S16-1145-01 A.M. FRIDAY, 17 June 2016 1 hour 30 minutes For s use ADDITIONAL MATERIALS In addition to this examination

More information

LED Driver 5 click. PID: MIKROE 3297 Weight: 25 g

LED Driver 5 click. PID: MIKROE 3297 Weight: 25 g LED Driver 5 click PID: MIKROE 3297 Weight: 25 g LED Driver 5 click is a Click board capable of driving an array of high-power LEDs with constant current, up to 1.5A. This Click board features the TPS54200,

More information

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny24/44/84. Preliminary

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny24/44/84. Preliminary Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

High performance, low power AVR 8-bit microcontroller Advanced RISC architecture. Non-volatile program and data memories. Peripheral features

High performance, low power AVR 8-bit microcontroller Advanced RISC architecture. Non-volatile program and data memories. Peripheral features ATtiny24/44/84 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash DATASHEET Features High performance, low power AVR 8-bit microcontroller Advanced RISC architecture 120 powerful

More information

PIC16C63A/65B/73B/74B

PIC16C63A/65B/73B/74B 8-Bit CMOS Microcontrollers with A/D Converter Devices included in this data sheet: PIC16C63A PIC16C65B PIC16CXX Microcontroller Core Features: High performance RISC CPU Only 35 single word instructions

More information

8-bit Microcontroller with 32K Bytes In-System Programmable Flash. ATmega32A

8-bit Microcontroller with 32K Bytes In-System Programmable Flash. ATmega32A Features High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 3 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

ATtiny102 / ATtiny104. Introduction. Feature. 8-bit AVR Microcontroller DATASHEET COMPLETE

ATtiny102 / ATtiny104. Introduction. Feature. 8-bit AVR Microcontroller DATASHEET COMPLETE 8-bit AVR Microcontroller ATtiny102 / ATtiny104 DATASHEET COMPLETE Introduction The Atmel ATtiny102/ATtiny104 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing

More information

Atmel ATA5771C/73C/74C

Atmel ATA5771C/73C/74C Atmel ATA5771C/73C/74C UHF ASK/FSK Transmitter with the Atmel AVR Microcontroller DATASHEET General Features Atmel AVR microcontroller and RF transmitter PLL in a single QFN24 5mm 5mm package (pitch 0.65mm)

More information

UHF ASK/FSK Transmitter with the Atmel AVR Microcontroller. Atmel ATA5771/73/74

UHF ASK/FSK Transmitter with the Atmel AVR Microcontroller. Atmel ATA5771/73/74 General Features Atmel AVR Microcontroller and RF Transmitter PLL in a Single QFN24 5mm 5mm Package (Pitch 0.65 mm) Operating Frequency Ranges 310MHz to 350MHz, 429MHz to 439MHz and 868MHz to 928MHz Temperature

More information

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny25 ATtiny45 ATtiny85. Automotive. BDTIC

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny25 ATtiny45 ATtiny85. Automotive. BDTIC BDTIC www.bdtic.com/atmel Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working

More information

PIC16CR7X Data Sheet. 28/40-Pin, 8-Bit CMOS ROM Microcontrollers Microchip Technology Inc. DS21993C

PIC16CR7X Data Sheet. 28/40-Pin, 8-Bit CMOS ROM Microcontrollers Microchip Technology Inc. DS21993C Data Sheet 28/40-Pin, 8-Bit CMOS ROM Microcontrollers 2007 Microchip Technology Inc. DS21993C Note the following details of the code protection feature on Microchip devices: Microchip products meet the

More information

Section 22. Basic 8-bit A/D Converter

Section 22. Basic 8-bit A/D Converter M Section 22. A/D Converter HIGHLIGHTS This section of the manual contains the following major topics: 22.1 Introduction...22-2 22.2 Control Registers...22-3 22.3 A/D Acquisition Requirements...22-6 22.4

More information

THE PERFORMANCE TEST OF THE AD CONVERTERS EMBEDDED ON SOME MICROCONTROLLERS

THE PERFORMANCE TEST OF THE AD CONVERTERS EMBEDDED ON SOME MICROCONTROLLERS THE PERFORMANCE TEST OF THE AD CONVERTERS EMBEDDED ON SOME MICROCONTROLLERS R. Holcer Department of Electronics and Telecommunications, Technical University of Košice, Park Komenského 13, SK-04120 Košice,

More information

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. Atmel ATtiny24/44/84. Automotive. Preliminary

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. Atmel ATtiny24/44/84. Automotive. Preliminary Features High Performance, Low Power AVR 8-bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

Interfacing Sensors & Modules to Microcontrollers

Interfacing Sensors & Modules to Microcontrollers Interfacing Sensors & Modules to Microcontrollers Presentation Topics I. Microprocessors & Microcontroller II. III. Hardware/software Tools for Interfacing Type of Sensors/Modules IV. Level Inputs (Digital

More information

µchameleon 2 User s Manual

µchameleon 2 User s Manual µchameleon 2 Firmware Rev 4.0 Copyright 2006-2011 Starting Point Systems. - Page 1 - firmware rev 4.0 1. General overview...4 1.1. Features summary... 4 1.2. USB CDC communication drivers... 4 1.3. Command

More information

APPENDIX A HARDWARE DETAILS

APPENDIX A HARDWARE DETAILS 7 APPENDIX A HARDWARE DETAILS A. COMPONENTS are listed below: Different components were used to implement the hardware. They. PIC Microcontroller 6F84A.. Voltage Regulators a. 78 voltage regulator b. 7805

More information

RW1026 Dot Matrix 48x4 LCD Controller / Driver

RW1026 Dot Matrix 48x4 LCD Controller / Driver Features Operating voltage: 2.4V~5.5V Internal LCD Bias generation with voltage-follower buffer External resistor CR oscillator External 256k Hz frequency source input Selection of 1/2 or 1/3 bias, and

More information

Design and Development of Smart. Harmonic Analyzer

Design and Development of Smart. Harmonic Analyzer Chapter - 4 Design and Development of Smart Harmonic Analyzer 4.1 Introduction: There is steady evolution in the field of generation, distribution, and use of electricity since many years. New methods

More information

Embedded Systems. Oscillator and I/O Hardware. Eng. Anis Nazer First Semester

Embedded Systems. Oscillator and I/O Hardware. Eng. Anis Nazer First Semester Embedded Systems Oscillator and I/O Hardware Eng. Anis Nazer First Semester 2016-2017 Oscillator configurations Three possible configurations for Oscillator (a) using a crystal oscillator (b) using an

More information

Part (A) Using the Potentiometer and the ADC* Part (B) LEDs and Stepper Motors with Interrupts* Part (D) Breadboard PIC Running a Stepper Motor

Part (A) Using the Potentiometer and the ADC* Part (B) LEDs and Stepper Motors with Interrupts* Part (D) Breadboard PIC Running a Stepper Motor Name Name (Most parts are team so maintain only 1 sheet per team) ME430 Mechatronic Systems: Lab 5: ADC, Interrupts, Steppers, and Servos The lab team has demonstrated the following tasks: Part (A) Using

More information

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny25/V * ATtiny45/V ATtiny85/V * * Preliminary

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny25/V * ATtiny45/V ATtiny85/V * * Preliminary Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 120 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static

More information

DS1065 EconOscillator/Divider

DS1065 EconOscillator/Divider wwwdalsemicom FEATURES 30 khz to 100 MHz output frequencies User-programmable on-chip dividers (from 1-513) User-programmable on-chip prescaler (1, 2, 4) No external components 05% initial tolerance 3%

More information

DASL 120 Introduction to Microcontrollers

DASL 120 Introduction to Microcontrollers DASL 120 Introduction to Microcontrollers Lecture 2 Introduction to 8-bit Microcontrollers Introduction to 8-bit Microcontrollers Introduction to 8-bit Microcontrollers Introduction to Atmel Atmega328

More information

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE 9S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE In this sequence of three labs you will learn to use the 9S12 S hardware sybsystem. WEEK 1 PULSE WIDTH MODULATION

More information

Microcontroller: Timers, ADC

Microcontroller: Timers, ADC Microcontroller: Timers, ADC Amarjeet Singh February 1, 2013 Logistics Please share the JTAG and USB cables for your assignment Lecture tomorrow by Nipun 2 Revision from last class When servicing an interrupt,

More information