ftp.nice.ch/peanuts/GeneralData/Usenet/news/1989/CSN-89.tar.gz#/comp-sys-next/1989/May-Jun/DSP-help-needed

This is DSP-help-needed in view mode; [Up]


Date: Sun 20-Jun-1989 23:58:18 From: Unknown Subject: Re: DSP help needed This code fragment configures the DSP environment 'properly.' I believe that you are right in saying that external ram seems to be disabled. This fixed my problems with using external ram. The reset vector should be: jmp >init init movec #6,omr ;data rom enabled, mode 2 bset #0,x:m_pbc ;host port movep #>$0001F7,x:m_pcc ;both serial ports (SC0 not available) bset #3,x:m_pcddr ; pc3 is an output with value bclr #3,x:m_pcd ; zero to enable the external ram movep #>$004000,x:m_cra ;set up for external clock on DSP port movep #>$002300,x:m_crb ;read L/~R on IF1 movep #>$000000,x:m_bcr ;no wait states on the external sram movep #>$00B400,x:m_ipr ;intr levels: SSI=2, SCI=1, HOST=0 _reset
Date: Sun 20-Jun-1989 20:18:27 From: Unknown Subject: DSP help needed I need to write some dsp routines that process arrays of data. I wrote a simple test program which reads an array from the host interface into DSP memory, then writes the array back to the host with each element shifted. The program works when I put the array into the DSP's on chip memory, but fails when I try to use the off chip memory at $2000. When it fails, all of the elements returned are copies of the last element written to the memory, as if the memory were not enabled or something. What am I doing wrong? Here's my code: ; array56k.asm DSP bootstrap program that reads an array, ; right shifts each element, and sends the array back to the host org p:0 reset jmp >rcv_cnt dup $40-2 ; output must be a contiguous segment nop endm org p:$40 ; starting address rcv_cnt jclr #0,x:$FFE9,rcv_cnt ; wait for data from host move x:$FFEB,R0 ; RO = count move #$2000,R1 ; R1 = array address in external memory do R0,end_rcv rcv_dat jclr #0,x:$FFE9,rcv_dat ; wait for data from host move x:$FFEB,A1 ; get word from host move A1,x:(R1)+ ; put it in external memory end_rcv move #$2000,R1 ; R1 = array address in external memory do R0,end_xmt move x:(R1)+,A1 ; get word from memory LSR A ; right-shift one place xmt_dat jclr #1,x:$FFE9,xmt_dat ; wait for host ready move A1,x:$FFEB ; send shifted word to host end_xmt jmp rcv_cnt end $40 #include <dsp/dsp.h> int count = 5; int data[] = {2,4,6,8,10}; main() { int i; DSPBootFile("array56k"); DSPPutTX(count); DSPPutTXArray(data,count); DSPGetRXArray(data,count); for (i = 0; i < count; i++) printf("%d ",data[i]); printf("\n"); DSPClose(); }

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.