Class Examples
Topic Examples
Atmel XMEGA
Examples
Table Load Example: Read values from a table in program memory, add the values, store the sum, and copy the program memory table to data memory
  • During AM class: f24_AM_Table_Load_Example.asm
  • During PM class: f24_PM_Table_Load_Example.asm
  • Same example with more comments and added instructions, i.e., play to learn! Table_Load_Example.asm

    Various Addressing Mode Examples:
  • Immediate Addressing (Imm_Addr.asm)
  • Indirect (indexed) Addressing (Indirect_Addr.asm)
  • Extended Addressing (Extended_Addr.asm)

    GPIO Example: Use the GPIO system (read inputs and write to outputs) of the XMEGA with uPAD
  • During AM class: f24_AM_GPIO_Output.asm
  • During PM class: f24_PM_GPIO_Output.asm
  • Same example with more! GPIO_Output.asm

    Stack Example:
  • Stack1.asm

    Vector Addition Example: Add two vectors using a subroutine and the stack
  • During class: f24_AM_VectorAdd.asm
  • During class: f24_PM_VectorAdd.asm
  • Same example with more! VectorAdd.asm

    External Interrupt Example: Using an external interrupt
  • During AM class: f24_AM_External_Interrupt.asm
  • During PM class: f24_PM_External_Interrupt.asm
  • Same example with more! External_Interrupt.asm

    Input Port Example: Creating an external (EBI) input port
  • During PM class: u24_Input_Port.asm
  • Same example with more! Input_Port.asm

    UART Example: Asynch. Serial Comm. (SCI) Polling Example
  • See video

    C Example: Serial w/ interrupt while blinking LEDs:
  • Echo serial input (w/ interrupt) to serial output while blinking LEDs (usart_serial.c)
  • Real-Time Counter (RTC) Example (RTC.asm)
  • Atmel XMEGA Parameter Passing
  • Parameters in internal registers (ParamPassing1a.asm)
  • Parameters address (pointer to program memory) in the internal registers (ParamPassing1b.asm)
  • Parameters address (pointer to data memory) in the internal registers (ParamPassing1c.asm)
  • Parameters in program memory space (ParamPassing2a.asm)
  • Parameters pointers in program memory space (ParamPassing2b.asm)
  • Parameters on stack (ParamPassing3a.asm)
  • Parameters pointers on stack (ParamPassing3b.asm)
  • Parameters in global (data) memory (ParamPassing4.asm)
  • Parameters in constants memory (ParamPassing5.asm)
  • Atmel XMEGA
    C
  • Usage of Simple If Statements (simple_if_statements.c)
  • Usage of Simple While Loops (simple_while_loops.c)
  • Usage of Multiple While Loops (multiple_while_loops.c)
  • Usage of If Statements and For Loops (if_and_for_loops.c)
  • Usage of Switch Statements (switch_statements.c)
  • EBI Setup and Use (ebi.c)
         * Header for Far Memory Access (for ebi.c and any programs that access 3 byte addresses on EBI) (ebi_driver.h)
  • USART library (.c and .h files) to configure the USARTD0 for async serial (Tx & Rx)
         * usart.c
         *
    usart.h
  • Echo serial input (w/ interrupt) to serial output while blinking LEDs (usart_serial.c)
  • Atmel XMEGA
    Mixed Assembly and C
  • Mixed C and Assembly file (.s) version of Vector Add example (requires project with VectorAdd_Mixed.s) (VectorAdd_Mixed.c)
  • Mixed C and Assembly file (.s) version of Vector Add example (requires project with VectorAdd_Mixed.c) (VectorAdd_ASM.s.txt) [Remove the .txt in the filename]
  • Mixed C and Inline Assembly version of Vector Add example (VectorADD_Casm.c)
  • C and Inline Assembly version of Input_Port example (Input_Port_C.c)
  • GCPU++
    Examples
  • IRQ Example A (counts to 255) (irq_inta.asm)
  • An SCI (Asynch. Serial) polling example using both Tx and Rx (sci_inchar_outchar.asm)
  • SPI Example (Master) (spi_master.asm)
  • SPI Example (Slave) (spi_slave.asm)
  • SPI Master Transmit & Receive a Table (spi_master_tab.asm)
  • SPI Output Port Expansion from HW (spi_out.asm)
  • A-to-D Example (ad_eeg.asm)
  • Multitasking examples
  • Addressing Modes (from 3701)
  • Immediate addressing mode (immaddr.asm)
  • Direct addressing mode (diraddr.asm)
  • Extended addressing mode (extaddr.asm)
  • Indexed addressing mode (indaddr.asm)
  • Phone example of indexed addressing mode (phone.asm)
  • Subroutine and stack interactions (sub_cntr.asm)
  • 68HC12 examples
  • 68HC12 Examples
  • 68HC11 examples
  • 68HC11 Examples
  • TI F28335 (DSC) examples
  • TI_F28335 (DSC) Examples