Sign in

username:

password:



Not a member?

Search c54x



Search tips

Subscribe to c54x



c54x by Keywords

5409 | 5416 | AD5 | ADC | BIOS | Boot | Booting | Bootloader | C540 | C5402 | C5409 | C5416 | CCS | Codec | DMA | Dmad | DSK | DSKPlus | Dsplib | EVM | FFT | FIR | Flash | GPIO | HPI | Initialization | Interrupt | JTAG | LOG_printf | MCBSP | RFFT | RTDX | Sampling | STLM | UART | VC540

Sponsor

NEW! TMS320C6474: 3x the performance. 1/3 the cost. Three 1 GHz cores on 1 chip.

Discussion Groups

Discussion Groups | TMS320C54x | Help on McBSP on 5409 a ( Oops file got dropped )

Technical discussions about the TI C54x DSPs (including the c5401, c5402, c5402a, c5404, c5407, c5409, c5409a, c5410, c5410a, c5416, c5420, c5421, c5441, c549, c5470 and c5471).

  

Post a new Thread

Help on McBSP on 5409 a ( Oops file got dropped ) - phil black - Jul 15 21:58:00 2002




Help on McBSP on 5409 a

Anyone
I have a problem thats making me nuts.
I have McBSP2 set to Clockstop mode (As a SPI MASTER)
to talk to a Ramtrom serial Ram. I can clock data out
to it ( Waveforms on the scope look perfect ).

I have a very simple routine to read the port, just
polling the RRDY line and moving the data into an
array. All signals again look perfect on the scope
CLK, CS, SI, SO all meet timing requirements. I can
see the data out of the ram is exactly what I clock
into it. The McBSP just is not reading it. Unless I
put a breakpoint


//<<<<<<<<<<<<<<<<<<<<<<& lt;<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<

u16 whaz_tx(){
unsigned int tw_stat,tw_temp;

tw_stat=0x0004;
*Mcbsp2_SubAddPtr = SPCR2_sa;

NOP;
NOP;
NOP;

while( tw_stat != 0 ){
tw_temp = *Mcbsp2_SubAddDataPtr;
tw_stat = tw_temp & 0x0004;
} while( tw_stat == 0 ){
tw_temp = *Mcbsp2_SubAddDataPtr;
tw_stat = tw_temp & 0x0002;
}

NOP;
NOP;
NOP;

}

//------------
u16 whaz_rx(){
unsigned int rw_stat,rw_temp,rw_err;

rw_err =1000;
rw_stat=0x0000;
*Mcbsp2_SubAddPtr = SPCR1_sa;
while( rw_stat == 0 ){
*Mcbsp2_SubAddPtr = SPCR1_sa;
rw_temp = *Mcbsp2_SubAddDataPtr;
rw_stat=rw_temp&0x0002;
rw_err--;
if (rw_err==0) return(1);
}

return(0);

} //>>>>>>>>>>>>>>>>>>>>>>>& gt;>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>
void philstest(){
unsigned int temp;

Smem =0x00; // force address 0

Mcbsp2_Init();

delay(500);

// *IMR = IMR_TINT;
// *IFR = 0xffff; // clear all pending interrupts

//- initizalizes enables
// GLOBAL_INT_ENABLE;
while(1){

tbuf[0]=0;
tbuf[1]=0;
tbuf[2]=0;
tbuf[3]=0;
tbuf[4]=0;
tbuf[5]=0;
tbuf[6]=0;
tbuf[7]=0;

//---------------------------------------------------------------------
temp =0;
goto jump_over; // jump over write data section for now ( I know its in there
now )

Mcbsp2_TX(0x06); // write enab
whaz_tx();
Smem =0x00; // deselect Mcbsp2_TX(0x02); // write command
Mcbsp2_TX(0x00); // addr
Mcbsp2_TX(0x00); // addr

Mcbsp2_TX(0x31); // val 1
Mcbsp2_TX(0x32); // val 2
Mcbsp2_TX(0x33); // val 3
Mcbsp2_TX(0x44); // val +
Mcbsp2_TX(0x45); // val +
Mcbsp2_TX(0x46); // val +
whaz_tx();

Smem =0x00; // deselect

jump_over:
//------->> Mcbsp2_TX(0x03); // read command
Mcbsp2_TX(0x00); // address
Mcbsp2_TX(0x00); // adresss //delay(2000); temp= *pMcBSP2_rr1; //clear anything in there <----- works if I put a
break here???

whaz_tx(); // <----- works if I put a break
here???

Mcbsp2_TX(0x00); // nulls for clocks <----- works if I put a break
here???
whaz_tx(); // << --------- errors(oxffff) on a
break here on first data ???

if (whaz_rx()==0) tbuf[0]= *pMcBSP2_rr1;
else tbuf[0]=0xffff;

Mcbsp2_TX(0x00); // nulls for clocks
whaz_tx();

if (whaz_rx()==0) tbuf[1]= *pMcBSP2_rr1;
else tbuf[1]=0xffff;

Smem =0x00; // deselect the chip select for the RAM

NOP;
NOP;
NOP;

if ((tbuf[0]!=0)||(tbuf[1]!=0)){
NOP; // <<<--------------------------------- break here to
see if got data in buffer
}

if (tbuf[0]!=0){
NOP;
}

NOP;
NOP;
NOP;

}





(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )

Re: Help on McBSP on 5409 a ( Oops file got dropped ) - phil black - Jul 17 13:25:00 2002

I figured out what I was doing wrong.
I forgot that the RX and TX clocks are
connected in SPI(Clock Stop) mode and the
RX buffer a triple buffer that so as I clock
out my address I'm clocking in the memory
command and address zero into the 3 RX buffers.

I just disabled the RX until I'm done clocking
out the command and address.

I'm a bit new to the TI MCBSP's I've
used ADI & MOT DSPS for the most part.
It was a dumb mistake(Aren't they all?)
I knew I was doing something silly.

Phil

--- phil black <> wrote:
>
> Help on McBSP on 5409 a
>
> Anyone
> I have a problem thats making me nuts.
> I have McBSP2 set to Clockstop mode (As a SPI
> MASTER)
> to talk to a Ramtrom serial Ram. I can clock data
> out
> to it ( Waveforms on the scope look perfect ).
>
> I have a very simple routine to read the port, just
> polling the RRDY line and moving the data into an
> array. All signals again look perfect on the scope
> CLK, CS, SI, SO all meet timing requirements. I can
> see the data out of the ram is exactly what I clock
> into it. The McBSP just is not reading it. Unless I
> put a breakpoint
>
> _____________________________________ > >
//<<<<<<<<<<<<<<<<<<<<<<<& lt;<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<
>
> u16 whaz_tx(){
> unsigned int tw_stat,tw_temp;
>
> tw_stat=0x0004;
> *Mcbsp2_SubAddPtr = SPCR2_sa;
>
> NOP;
> NOP;
> NOP;
>
> while( tw_stat != 0 ){
> tw_temp = *Mcbsp2_SubAddDataPtr;
> tw_stat = tw_temp & 0x0004;
> } > while( tw_stat == 0 ){
> tw_temp = *Mcbsp2_SubAddDataPtr;
> tw_stat = tw_temp & 0x0002;
> }
>
> NOP;
> NOP;
> NOP;
>
> }
>
> //------------
> u16 whaz_rx(){
> unsigned int rw_stat,rw_temp,rw_err;
>
> rw_err =1000;
> rw_stat=0x0000;
> *Mcbsp2_SubAddPtr = SPCR1_sa;
> while( rw_stat == 0 ){
> *Mcbsp2_SubAddPtr = SPCR1_sa;
> rw_temp = *Mcbsp2_SubAddDataPtr;
> rw_stat=rw_temp&0x0002;
> rw_err--;
> if (rw_err==0) return(1);
> }
>
> return(0);
>
> } >
//>>>>>>>>>>>>>>>>>>>>>>>& gt;>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>
> void philstest(){
> unsigned int temp;
>
> Smem =0x00; // force address 0
>
> Mcbsp2_Init();
>
> delay(500);
>
> // *IMR = IMR_TINT;
> // *IFR = 0xffff; // clear all pending
> interrupts
>
> //- initizalizes enables
> // GLOBAL_INT_ENABLE; >
> while(1){
>
> tbuf[0]=0;
> tbuf[1]=0;
> tbuf[2]=0;
> tbuf[3]=0;
> tbuf[4]=0;
> tbuf[5]=0;
> tbuf[6]=0;
> tbuf[7]=0; //---------------------------------------------------------------------
> temp =0;
> goto jump_over; // jump over write data section
> for now ( I know its in there now )
>
> Mcbsp2_TX(0x06); // write enab
> whaz_tx();
> Smem =0x00; // deselect > Mcbsp2_TX(0x02); // write command
> Mcbsp2_TX(0x00); // addr
> Mcbsp2_TX(0x00); // addr
>
> Mcbsp2_TX(0x31); // val 1
> Mcbsp2_TX(0x32); // val 2
> Mcbsp2_TX(0x33); // val 3
> Mcbsp2_TX(0x44); // val +
> Mcbsp2_TX(0x45); // val +
> Mcbsp2_TX(0x46); // val +
> whaz_tx();
>
> Smem =0x00; // deselect
>
> jump_over:
> //------->> > Mcbsp2_TX(0x03); // read command
> Mcbsp2_TX(0x00); // address
> Mcbsp2_TX(0x00); // adresss > //delay(2000); > temp= *pMcBSP2_rr1; //clear anything in there
> <----- works if I put a break here???
>
> whaz_tx(); //
> <----- works if I put a break here???
>
> Mcbsp2_TX(0x00); // nulls for clocks
> <----- works if I put a break here???
> whaz_tx(); // <<
> --------- errors(oxffff) on a break here on first
> data ???
>
> if (whaz_rx()==0) tbuf[0]= *pMcBSP2_rr1;
> else tbuf[0]=0xffff;
>
> Mcbsp2_TX(0x00); // nulls for clocks
> whaz_tx();
>
> if (whaz_rx()==0) tbuf[1]= *pMcBSP2_rr1;
> else tbuf[1]=0xffff;
>
> Smem =0x00; // deselect the chip select for
> the RAM
>
> NOP;
> NOP;
> NOP;
>
> if ((tbuf[0]!=0)||(tbuf[1]!=0)){
> NOP; //
> <<<--------------------------------- break here to
> see if got data in buffer
> }
>
> if (tbuf[0]!=0){
> NOP;
> }
>
> NOP;
> NOP;
> NOP;
>
> } __________________________________________________




(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )