13.07.2015 Views

TMS320C5x DSP STARTER KIT USER'S GUIDE

TMS320C5x DSP STARTER KIT USER'S GUIDE

TMS320C5x DSP STARTER KIT USER'S GUIDE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Getting Started3.4 Getting StartedExample 3–1. Source File try1.asmThis section provides a quick walkthrough so that you can get started withoutreading the entire user’s guide. These examples show the most commonmethods for invoking the assembler and debugger.1) Create a short source file to use for the walkthrough; call it try1.asm.******************************************************************************** Saw–toothed Wave Generator ** Ramp rate is determined by interrupt rate and step size. Ramp is made by ** numerical rollover. No AIC initialization, using the default value. ********************************************************************************; Declare memory–mapped registers and; program block address.mmregs; Include memory map reg.ps 0080ch ;B XINT ; Set transmit interrupt vector.ps 00a00h ;.entry; Initial PC addressLDP #0 ; Load Data Page for DXR (Zero)CALL SP_init ; Call serial port initialize functionLAMM IMR ;OR #20h ; Unmask receive interrupt (XINT)SAMM IMR ;SPLK #0ffffh, IFR; Clear pending interruptLOOP: ADD #10 ; Increment ACCU by 10SACL DXR,3 ; Shift ACCU left 3 bits when storingIDLE; Wait for D/A interruptB LOOP ;XINT: RETE ; Reenable interruptsSP_init:SPLK #01h,PRD ; Generate 10 MHz clock from TOUT toSPLK #20h,TCR ; support AIC master clockMAR *,AR0 ;LACC #0080h ; Set 00000080h => ACCSACH DXR ; Clear DXRSACL GREG ; Set GREG = 80h, >8000h memory = GlobalLAR AR0,#0FFFFh ; AR0 point to global memoryRPT #9999 ; Bring the BR low for 10000 cyclesLACC *,0,AR0 ; (.5ms at 50ns)SACH GREG ; Disable global memoryLACC #0008h ; Put serial port in reset and configure asSACL SPC ; burst mode, FSX input, and data length 16 bitsLACC #80c8h ;SACL SPC ; Bring the serial port out of resetRETOverview of a Code Development and Debugging System3-5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!