Analog Devices ee-03 Application Notes

Engineer To Engineer Note EE-3
Notes on using Analog Devices’ DSP, audio, & video components from the Computer Products Division
Phone: (800) ANALOG-D or (781) 461-3881, FAX: (781) 461-3010, EMAIL: dsp.support@analog.com
Writing to Flash Memory on the ADSP-2106x
Last Modified: 10/24/96
Introduction
This note explains how to write to ADSP-2106x (SHARC) BMS space using the boot select override (BSO mode). The explanation includes a general description of BSO operations and a source code example for writing to flash memory or EEPROM.
The BSO (Boot Select Override) mode bit in the SYSCON register allows the BMS pin to be asserted
under software control. In PROM boot mode, an initial 256-word boot-kernel is automatically read from an 8-bit wide PROM. This kernel can set the BSO bit to let the DSP read the remaining application code from the PROM. In many systems, the boot data may need to be updated or modified. In these cases, the PROM may be substituted by a write-able EEPROM or FLASH memory. The code example demonstrates how to write to the same memory space, selected by the BMS pin, that the
SHARC reads from in PROM boot mode.
When BSO is set, DMA channels 7-9 can be used with any of the modes available in the DMACx register (for read or write), any packing mode, and any data or instruction.
BSO Write Code Example
The following code example uses DMA channel 7 to write to an 8-bit wide memory connected to pins DATA23-16 of the EP bus. The connections between the SHARC and flash memory appear in Figure 1. Following the code example, an architecture file for a corresponding SHARC­flash-memory system appears.
DATA 47-0
FLASH
DMA READ
FLASH DMA
WRITE
Figure 1 - SHARC-To-Flash-Memory Connections
078151623243132394047
Notes on BSO operation
When BSO is set, the BMS pin will assert only on an External Port (EP) DMA read or write. BMS does not assert on a DSP core access of the EP.
When BSO is set, an EP DMA does not assert the MS1x pins. DSP core accesses are not affected by BSO.
To write to memory with the BMS asserted, use DMA channels 7, 8 or 9. DMA channel 6 should only be used
for a read when BSO is set. This limitation of accesses appears because DMA channel 6 is hardwired for a special 8-bit boot read mode
When BSO is set, a write with DMA channel 6 with BSO set results in illegal chip operation.
/*________________________________________
BSOWRITE.ASM ADSP-21060 Flash Write Transfer Example
________________________________________*/
/* define number of 48-bit words to write to FLASH */
#define N 8 #include "def21060.h" .SEGMENT/DM dm32_b1; .VAR temp; .ENDSEG; .SEGMENT/DM extdata;
/* Location of FLASH memory */ .VAR flash[N*6]; .ENDSEG;
/* interrupt vector table */ .SEGMENT/PM pm48_1b0; resoi: nop;nop;nop;nop;
reset: nop;nop;nop;jump start; res1i: nop;nop;nop;rti;
sovfi: nop;nop;nop;rti;
/* status stack ovflw, PC stack full */
tmzhi: nop;nop;nop;rti;
/* timer high priority */
virpt: nop;nop;nop;rti;
/* vector interrupt */
irq2i: nop;nop;nop;rti;
/* irq2 asserted */
irq1i: nop;nop;nop;rti;
/* irq1 asserted */
irq0i: nop;nop;nop;rti;
/* irq0 asserted */
res2i: nop;nop;nop;rti;
spr0i: nop;nop;nop;rti;
/* sport0 receive DMA */
spr1i:lp0i: nop;nop;nop;rti;
/* sport1 receive or link port 0 DMA */
spt0i: nop;nop;nop;rti;
/* sport0 transmit or link port 0 DMA*/
spt1i:lp1i: nop;nop;nop;rti;
/* sport1 transmit DMA */
lp2i: nop;nop;nop;rti;
/* link port 2 DMA */
lp3i: nop;nop;nop;rti;
/* link port 3 DMA */
ep0i:lp4i: nop;nop;nop;rti;
/* reserved */
/* reserved */
/* reserved */
/* ext port 0 or link port 4 DMA */
ep1i:lp5i: nop;nop;nop;rti;
/* ext port 1 or link port 5 DMA */
ep2i: nop;nop;nop;rti;
/* ext port 2 DMA */
ep3i: nop;nop;nop;rti;
/* ext port 3 DMA */
.VAR source[N];
/* block of 48-bit wide test data */
/*_______ start of main routine ________*/
start: ustat1=0x00108421; dm(WAIT)=ustat1;
/* No waistates enabled in example */
px1=0x2211;
/* Fill source with test data */ px2=0x66554433; i8=source; l8=0; m8=1; lcntr=@source; do fill_tst until lce; fill_tst: pm(i8,m8)=px;
call write_block; /* Write out source */
stop: jump stop;
/* --------------------------------------­Write block of 48-bit words to 8-bit wide
memory with BMS pin asserted
---------------------------------------- */ write_block: i8=source;
EE-3 Page 2
Notes on using Analog Devices’ DSP, audio, & video components from the Computer Products Division
Phone: (800) ANALOG-D or (781) 461-3881, FAX: (781) 461-3010, EMAIL: dsp.support@analog.com
Loading...
+ 2 hidden pages