From: m... [mailto:m...] On Behalf Of Onestone
Sent: Thursday, October 04, 2012 2:41 PM
To: m...
Subject: Re: [msp430] Re: MSP430F2619 DMA block transfer
In my opinion yes. Check after the command has completed, ie data
transferred, you are crippling the SPI by checking status every byte
transfer.
Al
On 5/10/2012 3:45 AM, Hugo Brunert wrote: > Shouldn't you check every time, in case you get
a BUSY status?
>
> Meaning you should wait and retry?
>
> Not that is has ever happened, but I do provide for it, am I wasting effort
and time?
>
>
>
> From: m... [mailto:ms...
] On Behalf Of Onestone
> Sent: Thursday, October 04, 2012 1:32 PM
> To: m...
> Subject: Re: [msp430] Re: MSP430F2619 DMA block transfer
>
>
>
>
>
> A status check is always a good thing, but check your memory data sheet,
> I believe that some memories, in fact the 4 I've just looked at,
return
> status on the byte after the command byte, and every byte thereafter
> when writing the memory, so it is a simple case of enabling the SPI
> receive and checking the returned data.
>
> My typical SPI sequence looks something like:-
>
> set transaction length
> enable ISR
> send command byte to start things going.
>
> in ISR, on first call enable RX isr
> load next byte in to buffer
>
> the Rx isr then collects stsua.
>
> OR you can run only on the RX isr and get status every transmit, so the
> isr does:-
>
> get rxbuffer
> send next byte
> packet length checks
>
> and you can decide when you want to actually test the status.
>
> Al
>
> On 5/10/2012 2:01 AM, Hugo Brunert wrote:
>> I may be wrong, but I thought you needed STATUS in between CMD & ADDRs &
data.
>>
>> At least I use it. Am I wasting time by using status en between each Xfer?
>>
>> From: m...
[mailto:m...
] On Behalf Of favero.santos
>> Sent: Thursday, October 04, 2012 12:27 PM
>> To: m...
>> Subject: [msp430] Re: MSP430F2619 DMA block transfer
>>
>> Hello, Felipe.
>>
>> Nice to find another brazilian in this forum.
>>
>> DMA0SA = (int)&endereco+1;
>> this means DMA should use as source address the next byte of the int
endereco.
>>
>> Example:
>> int endereco 0x2010.
>> In memory, it will be stored as:
>> 0x10 0x20.
>> Writing the cmd as i did, 0x20 will be pointed firstly (if DMA0SA =
(int)&endereco, 0x10 will be pointed firstly).
>>
>> Anyway, i found another solution:
>>
>> I'll make a block of CMD (1byte) + ADDS (2 bytes) + data (1k byte) and
send as an unique block (the way first way was sending with DMA separated
blocks!)
>>
>> Cheers!
>>
>> --- In m...
, Luis Rossi
wrote:
>>> But what is the problem? Wrong data at SPI port, or no data at all? Still
>>> you are going to have a problem with your trigger as it wont wait untill
>>> the SPI TX buffer is empty to send the new data.
>>>
>>> And what is the meaning of this cast?
>>>
>>> DMA0SA = (int)&endereco+1;
>>>
>>> Regards,
>>>
>>> --
>>> Lu Filipe Rossi
>>> Electrical Engineer
>>> Biomechatronics Lab. / Grupo de Sensores Integreis e Sistemas
>>> Escola Politnica
>>> Universidade de S Paulo
>>> Cel. +55 (11) 7662-9234
>>>
>>>
>>>
>>>
>>
>>
>>
>>
I think i'll add an interruption to take that nasty "while" off the
code.
Thx
On Thu, Oct 4, 2012 at 3:41 PM, Onestone wrote:
> **
> In my opinion yes. Check after the command has completed, ie data
> transferred, you are crippling the SPI by checking status every byte
> transfer.
>
> Al
> On 5/10/2012 3:45 AM, Hugo Brunert wrote:
> > Shouldn't you check every time, in case you get a BUSY status?
> >
> > Meaning you should wait and retry?
> >
> > Not that is has ever happened, but I do provide for it, am I wasting
> effort and time?
> >
> >
> >
> > From: m... [mailto:m...] On Behalf
> Of Onestone
> > Sent: Thursday, October 04, 2012 1:32 PM
> > To: m...
> > Subject: Re: [msp430] Re: MSP430F2619 DMA block transfer
> >
> >
> >
> >
> >
> > A status check is always a good thing, but check your memory data sheet,
> > I believe that some memories, in fact the 4 I've just looked at,
return
> > status on the byte after the command byte, and every byte thereafter
> > when writing the memory, so it is a simple case of enabling the SPI
> > receive and checking the returned data.
> >
> > My typical SPI sequence looks something like:-
> >
> > set transaction length
> > enable ISR
> > send command byte to start things going.
> >
> > in ISR, on first call enable RX isr
> > load next byte in to buffer
> >
> > the Rx isr then collects stsua.
> >
> > OR you can run only on the RX isr and get status every transmit, so the
> > isr does:-
> >
> > get rxbuffer
> > send next byte
> > packet length checks
> >
> > and you can decide when you want to actually test the status.
> >
> > Al
> >
> > On 5/10/2012 2:01 AM, Hugo Brunert wrote:
> >> I may be wrong, but I thought you needed STATUS in between CMD & ADDRs
> & data.
> >>
> >> At least I use it. Am I wasting time by using status en between each
> Xfer?
> >>
> >>
> >>
> >> From: m... [mailto:
> m... ] On Behalf Of
> favero.santos
> >> Sent: Thursday, October 04, 2012 12:27 PM
> >> To: m...
> >> Subject: [msp430] Re: MSP430F2619 DMA block transfer
> >>
> >>
> >>
> >>
> >>
> >> Hello, Felipe.
> >>
> >> Nice to find another brazilian in this forum.
> >>
> >> DMA0SA = (int)&endereco+1;
> >> this means DMA should use as source address the next byte of the int
> endereco.
> >>
> >> Example:
> >> int endereco 0x2010.
> >> In memory, it will be stored as:
> >> 0x10 0x20.
> >> Writing the cmd as i did, 0x20 will be pointed firstly (if DMA0SA =
> (int)&endereco, 0x10 will be pointed firstly).
> >>
> >> Anyway, i found another solution:
> >>
> >> I'll make a block of CMD (1byte) + ADDS (2 bytes) + data (1k byte)
and
> send as an unique block (the way first way was sending with DMA separated
> blocks!)
> >>
> >> Cheers!
> >>
> >> --- In m...
> , Luis Rossi wrote:
> >>> But what is the problem? Wrong data at SPI port, or no data at all?
> Still
> >>> you are going to have a problem with your trigger as it wont wait
> untill
> >>> the SPI TX buffer is empty to send the new data.
> >>>
> >>> And what is the meaning of this cast?
> >>>
> >>> DMA0SA = (int)&endereco+1;
> >>>
> >>> Regards,
> >>>
> >>> --
> >>> Lu Filipe Rossi
> >>> Electrical Engineer
> >>> Biomechatronics Lab. / Grupo de Sensores Integreis e Sistemas
> >>> Escola Politnica
> >>> Universidade de S Paulo
> >>> Cel. +55 (11) 7662-9234
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >>
> >>
Reply by Onestone●October 4, 20122012-10-04
Good, glad you managed to solve your problems.
Al
On 5/10/2012 3:49 AM, Fero Santos wrote: > Hello, Onestone
>
> Finally, got it working :)
>
> Check it out:
> /* These guys are my data i'm kicking off SPI with DMA */
>
> ALS[1] = 0x00; // ADDR, MSByte
> ALS[2] = 0x00; // ADDR, LSByte
> ALS[3] = 0x55; // From here to AL[6], just some values i added */
> ALS[4] = 0x55;
> ALS[5] = 0x66;
> ALS[6] = 0x77;
>
> DMACTL0 = 0;
> // Cleans DMA0 register
> DMACTL0 |= DMA0TSEL_13;
> // Trigger source as UCB0TX Interrupt flag
> DMA0CTL |= DMASRCINCR_3 + DMADSTINCR_0 + DMADT_0 + DMASBDB;
> // DMASRCINCR_3 -> Source add increment
> // DMADSTINCR_0 -> Destination add without increment/decrement
> // DMADT_0 -> Single transfer
> // DMASBDB -> Byte to Byte transfer
>
> DMA0SA = (unsigned short)&ALS + 1;
> // Source addrs: I'm pointing to ALS[1] instead of ALS[0]
>
> DMA0DA = (unsigned short)&UCB0TXBUF;
> // Destination addrs: Pointing to transfer buffer
>
> DMA0SZ = 6;
> // Transfer size, in bytes
>
> CS_LOW();
> // A chip select in my device (RAM 23k256)
>
> DMA0CTL |= DMAEN + DMAREQ;
> // An enable for DMA
>
> ram_send_byte(0x02);
> // Kickoff firts byte (CMD byte) to start block transfer
>
> while(DMA0SZ == 0){};
> // Do DMA transfer while there's data to be sent
>
> CS_HIGH();
> // Deassert CS
>
> Scope shows me a perfect and smooth data transmission.
> Reading the address from RAM returns me data sent to be stored.
>
> Cheers
> On Thu, Oct 4, 2012 at 2:32 PM, Onestone wrote:
>
>> **
>> A status check is always a good thing, but check your memory data sheet,
>> I believe that some memories, in fact the 4 I've just looked at,
return
>> status on the byte after the command byte, and every byte thereafter
>> when writing the memory, so it is a simple case of enabling the SPI
>> receive and checking the returned data.
>>
>> My typical SPI sequence looks something like:-
>>
>> set transaction length
>> enable ISR
>> send command byte to start things going.
>>
>> in ISR, on first call enable RX isr
>> load next byte in to buffer
>>
>> the Rx isr then collects stsua.
>>
>> OR you can run only on the RX isr and get status every transmit, so the
>> isr does:-
>>
>> get rxbuffer
>> send next byte
>> packet length checks
>>
>> and you can decide when you want to actually test the status.
>>
>> Al
>> On 5/10/2012 2:01 AM, Hugo Brunert wrote:
>>> I may be wrong, but I thought you needed STATUS in between CMD & ADDRs &
>> data.
>>> At least I use it. Am I wasting time by using status en between each
>> Xfer?
>>>
>>>
>>> From: m... [mailto:m...] On Behalf
>> Of favero.santos
>>> Sent: Thursday, October 04, 2012 12:27 PM
>>> To: m...
>>> Subject: [msp430] Re: MSP430F2619 DMA block transfer
>>>
>>>
>>>
>>>
>>>
>>> Hello, Felipe.
>>>
>>> Nice to find another brazilian in this forum.
>>>
>>> DMA0SA = (int)&endereco+1;
>>> this means DMA should use as source address the next byte of the int
>> endereco.
>>> Example:
>>> int endereco 0x2010.
>>> In memory, it will be stored as:
>>> 0x10 0x20.
>>> Writing the cmd as i did, 0x20 will be pointed firstly (if DMA0SA >>
(int)&endereco, 0x10 will be pointed firstly).
>>> Anyway, i found another solution:
>>>
>>> I'll make a block of CMD (1byte) + ADDS (2 bytes) + data (1k byte)
and
>> send as an unique block (the way first way was sending with DMA separated
>> blocks!)
>>> Cheers!
>>>
>>> --- In m... , Luis
>> Rossi wrote:
>>>> But what is the problem? Wrong data at SPI port, or no data at all?
>> Still
>>>> you are going to have a problem with your trigger as it wont wait untill
>>>> the SPI TX buffer is empty to send the new data.
>>>>
>>>> And what is the meaning of this cast?
>>>>
>>>> DMA0SA = (int)&endereco+1;
>>>>
>>>> Regards,
>>>>
>>>> --
>>>> Lu Filipe Rossi
>>>> Electrical Engineer
>>>> Biomechatronics Lab. / Grupo de Sensores Integreis e Sistemas
>>>> Escola Politnica
>>>> Universidade de S Paulo
>>>> Cel. +55 (11) 7662-9234
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
Reply by Onestone●October 4, 20122012-10-04
In my opinion yes. Check after the command has completed, ie data
transferred, you are crippling the SPI by checking status every byte
transfer.
Al
On 5/10/2012 3:45 AM, Hugo Brunert wrote: > Shouldn't you check every time, in case you get
a BUSY status?
>
> Meaning you should wait and retry?
>
> Not that is has ever happened, but I do provide for it, am I wasting effort
and time?
>
>
>
> From: m... [mailto:m...] On Behalf Of Onestone
> Sent: Thursday, October 04, 2012 1:32 PM
> To: m...
> Subject: Re: [msp430] Re: MSP430F2619 DMA block transfer
>
>
>
>
>
> A status check is always a good thing, but check your memory data sheet,
> I believe that some memories, in fact the 4 I've just looked at,
return
> status on the byte after the command byte, and every byte thereafter
> when writing the memory, so it is a simple case of enabling the SPI
> receive and checking the returned data.
>
> My typical SPI sequence looks something like:-
>
> set transaction length
> enable ISR
> send command byte to start things going.
>
> in ISR, on first call enable RX isr
> load next byte in to buffer
>
> the Rx isr then collects stsua.
>
> OR you can run only on the RX isr and get status every transmit, so the
> isr does:-
>
> get rxbuffer
> send next byte
> packet length checks
>
> and you can decide when you want to actually test the status.
>
> Al
>
> On 5/10/2012 2:01 AM, Hugo Brunert wrote:
>> I may be wrong, but I thought you needed STATUS in between CMD & ADDRs &
data.
>>
>> At least I use it. Am I wasting time by using status en between each Xfer?
>>
>> From: m... [mailto:m...
] On Behalf Of favero.santos
>> Sent: Thursday, October 04, 2012 12:27 PM
>> To: m...
>> Subject: [msp430] Re: MSP430F2619 DMA block transfer
>>
>> Hello, Felipe.
>>
>> Nice to find another brazilian in this forum.
>>
>> DMA0SA = (int)&endereco+1;
>> this means DMA should use as source address the next byte of the int
endereco.
>>
>> Example:
>> int endereco 0x2010.
>> In memory, it will be stored as:
>> 0x10 0x20.
>> Writing the cmd as i did, 0x20 will be pointed firstly (if DMA0SA =
(int)&endereco, 0x10 will be pointed firstly).
>>
>> Anyway, i found another solution:
>>
>> I'll make a block of CMD (1byte) + ADDS (2 bytes) + data (1k byte) and
send as an unique block (the way first way was sending with DMA separated
blocks!)
>>
>> Cheers!
>>
>> --- In m...
, Luis Rossi wrote:
>>> But what is the problem? Wrong data at SPI port, or no data at all? Still
>>> you are going to have a problem with your trigger as it wont wait untill
>>> the SPI TX buffer is empty to send the new data.
>>>
>>> And what is the meaning of this cast?
>>>
>>> DMA0SA = (int)&endereco+1;
>>>
>>> Regards,
>>>
>>> --
>>> Lu Filipe Rossi
>>> Electrical Engineer
>>> Biomechatronics Lab. / Grupo de Sensores Integreis e Sistemas
>>> Escola Politnica
>>> Universidade de S Paulo
>>> Cel. +55 (11) 7662-9234
>>>
>>>
>>>
>>>
>>
>>
>>
>>
Reply by ●October 4, 20122012-10-04
Hello, Onestone
Finally, got it working :)
Check it out:
/* These guys are my data i'm kicking off SPI with DMA */
ALS[1] = 0x00; // ADDR, MSByte
ALS[2] = 0x00; // ADDR, LSByte
ALS[3] = 0x55; // From here to AL[6], just some values i added */
ALS[4] = 0x55;
ALS[5] = 0x66;
ALS[6] = 0x77;
DMACTL0 = 0;
// Cleans DMA0 register
DMACTL0 |= DMA0TSEL_13;
// Trigger source as UCB0TX Interrupt flag
DMA0CTL |= DMASRCINCR_3 + DMADSTINCR_0 + DMADT_0 + DMASBDB;
// DMASRCINCR_3 -> Source add increment
// DMADSTINCR_0 -> Destination add without increment/decrement
// DMADT_0 -> Single transfer
// DMASBDB -> Byte to Byte transfer
DMA0SA = (unsigned short)&ALS + 1;
// Source addrs: I'm pointing to ALS[1] instead of ALS[0]
DMA0DA = (unsigned short)&UCB0TXBUF;
// Destination addrs: Pointing to transfer buffer
DMA0SZ = 6;
// Transfer size, in bytes
CS_LOW();
// A chip select in my device (RAM 23k256)
DMA0CTL |= DMAEN + DMAREQ;
// An enable for DMA
ram_send_byte(0x02);
// Kickoff firts byte (CMD byte) to start block transfer
while(DMA0SZ == 0){};
// Do DMA transfer while there's data to be sent
CS_HIGH();
// Deassert CS
Scope shows me a perfect and smooth data transmission.
Reading the address from RAM returns me data sent to be stored.
Cheers
On Thu, Oct 4, 2012 at 2:32 PM, Onestone wrote:
> **
> A status check is always a good thing, but check your memory data sheet,
> I believe that some memories, in fact the 4 I've just looked at,
return
> status on the byte after the command byte, and every byte thereafter
> when writing the memory, so it is a simple case of enabling the SPI
> receive and checking the returned data.
>
> My typical SPI sequence looks something like:-
>
> set transaction length
> enable ISR
> send command byte to start things going.
>
> in ISR, on first call enable RX isr
> load next byte in to buffer
>
> the Rx isr then collects stsua.
>
> OR you can run only on the RX isr and get status every transmit, so the
> isr does:-
>
> get rxbuffer
> send next byte
> packet length checks
>
> and you can decide when you want to actually test the status.
>
> Al
> On 5/10/2012 2:01 AM, Hugo Brunert wrote:
> > I may be wrong, but I thought you needed STATUS in between CMD & ADDRs &
> data.
> >
> > At least I use it. Am I wasting time by using status en between each
> Xfer?
> >
> >
> >
> > From: m... [mailto:m...] On Behalf
> Of favero.santos
> > Sent: Thursday, October 04, 2012 12:27 PM
> > To: m...
> > Subject: [msp430] Re: MSP430F2619 DMA block transfer
> >
> >
> >
> >
> >
> > Hello, Felipe.
> >
> > Nice to find another brazilian in this forum.
> >
> > DMA0SA = (int)&endereco+1;
> > this means DMA should use as source address the next byte of the int
> endereco.
> >
> > Example:
> > int endereco 0x2010.
> > In memory, it will be stored as:
> > 0x10 0x20.
> > Writing the cmd as i did, 0x20 will be pointed firstly (if DMA0SA =
> (int)&endereco, 0x10 will be pointed firstly).
> >
> > Anyway, i found another solution:
> >
> > I'll make a block of CMD (1byte) + ADDS (2 bytes) + data (1k byte)
and
> send as an unique block (the way first way was sending with DMA separated
> blocks!)
> >
> > Cheers!
> >
> > --- In m... , Luis
> Rossi wrote:
> >> But what is the problem? Wrong data at SPI port, or no data at all?
> Still
> >> you are going to have a problem with your trigger as it wont wait untill
> >> the SPI TX buffer is empty to send the new data.
> >>
> >> And what is the meaning of this cast?
> >>
> >> DMA0SA = (int)&endereco+1;
> >>
> >> Regards,
> >>
> >> --
> >> Lu Filipe Rossi
> >> Electrical Engineer
> >> Biomechatronics Lab. / Grupo de Sensores Integreis e Sistemas
> >> Escola Politnica
> >> Universidade de S Paulo
> >> Cel. +55 (11) 7662-9234
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> >
> >
> >
> >
Reply by Hugo Brunert●October 4, 20122012-10-04
Shouldn't you check every time, in case you get a BUSY status?
Meaning you should wait and retry?
Not that is has ever happened, but I do provide for it, am I wasting effort and
time?
From: m... [mailto:m...] On Behalf Of Onestone
Sent: Thursday, October 04, 2012 1:32 PM
To: m...
Subject: Re: [msp430] Re: MSP430F2619 DMA block transfer
A status check is always a good thing, but check your memory data sheet,
I believe that some memories, in fact the 4 I've just looked at, return
status on the byte after the command byte, and every byte thereafter
when writing the memory, so it is a simple case of enabling the SPI
receive and checking the returned data.
My typical SPI sequence looks something like:-
set transaction length
enable ISR
send command byte to start things going.
in ISR, on first call enable RX isr
load next byte in to buffer
the Rx isr then collects stsua.
OR you can run only on the RX isr and get status every transmit, so the
isr does:-
get rxbuffer
send next byte
packet length checks
and you can decide when you want to actually test the status.
Al
On 5/10/2012 2:01 AM, Hugo Brunert wrote: > I may be wrong, but I thought you needed STATUS in
between CMD & ADDRs & data.
>
> At least I use it. Am I wasting time by using status en between each Xfer?
>
>
>
> From: m... [mailto:ms...
] On Behalf Of favero.santos
> Sent: Thursday, October 04, 2012 12:27 PM
> To: m...
> Subject: [msp430] Re: MSP430F2619 DMA block transfer
>
>
>
>
>
> Hello, Felipe.
>
> Nice to find another brazilian in this forum.
>
> DMA0SA = (int)&endereco+1;
> this means DMA should use as source address the next byte of the int
endereco.
>
> Example:
> int endereco 0x2010.
> In memory, it will be stored as:
> 0x10 0x20.
> Writing the cmd as i did, 0x20 will be pointed firstly (if DMA0SA =
(int)&endereco, 0x10 will be pointed firstly).
>
> Anyway, i found another solution:
>
> I'll make a block of CMD (1byte) + ADDS (2 bytes) + data (1k byte) and
send as an unique block (the way first way was sending with DMA separated
blocks!)
>
> Cheers!
>
> --- In m...
, Luis Rossi wrote:
>> But what is the problem? Wrong data at SPI port, or no data at all? Still
>> you are going to have a problem with your trigger as it wont wait untill
>> the SPI TX buffer is empty to send the new data.
>>
>> And what is the meaning of this cast?
>>
>> DMA0SA = (int)&endereco+1;
>>
>> Regards,
>>
>> --
>> Lu Filipe Rossi
>> Electrical Engineer
>> Biomechatronics Lab. / Grupo de Sensores Integreis e Sistemas
>> Escola Politnica
>> Universidade de S Paulo
>> Cel. +55 (11) 7662-9234
>>
>>
>
>
>
>
>
Reply by Onestone●October 4, 20122012-10-04
A status check is always a good thing, but check your memory data sheet,
I believe that some memories, in fact the 4 I've just looked at, return
status on the byte after the command byte, and every byte thereafter
when writing the memory, so it is a simple case of enabling the SPI
receive and checking the returned data.
My typical SPI sequence looks something like:-
set transaction length
enable ISR
send command byte to start things going.
in ISR, on first call enable RX isr
load next byte in to buffer
the Rx isr then collects stsua.
OR you can run only on the RX isr and get status every transmit, so the
isr does:-
get rxbuffer
send next byte
packet length checks
and you can decide when you want to actually test the status.
Al
On 5/10/2012 2:01 AM, Hugo Brunert wrote: > I may be wrong, but I thought you needed STATUS in
between CMD & ADDRs & data.
>
> At least I use it. Am I wasting time by using status en between each Xfer?
>
>
>
> From: m... [mailto:m...] On Behalf Of favero.santos
> Sent: Thursday, October 04, 2012 12:27 PM
> To: m...
> Subject: [msp430] Re: MSP430F2619 DMA block transfer
>
>
>
>
>
> Hello, Felipe.
>
> Nice to find another brazilian in this forum.
>
> DMA0SA = (int)&endereco+1;
> this means DMA should use as source address the next byte of the int
endereco.
>
> Example:
> int endereco 0x2010.
> In memory, it will be stored as:
> 0x10 0x20.
> Writing the cmd as i did, 0x20 will be pointed firstly (if DMA0SA =
(int)&endereco, 0x10 will be pointed firstly).
>
> Anyway, i found another solution:
>
> I'll make a block of CMD (1byte) + ADDS (2 bytes) + data (1k byte) and
send as an unique block (the way first way was sending with DMA separated
blocks!)
>
> Cheers!
>
> --- In m... , Luis Rossi
wrote:
>> But what is the problem? Wrong data at SPI port, or no data at all? Still
>> you are going to have a problem with your trigger as it wont wait untill
>> the SPI TX buffer is empty to send the new data.
>>
>> And what is the meaning of this cast?
>>
>> DMA0SA = (int)&endereco+1;
>>
>> Regards,
>>
>> --
>> Lu Filipe Rossi
>> Electrical Engineer
>> Biomechatronics Lab. / Grupo de Sensores Integreis e Sistemas
>> Escola Politnica
>> Universidade de S Paulo
>> Cel. +55 (11) 7662-9234
>>
>>
>
>
>
Reply by Onestone●October 4, 20122012-10-04
Right, provided the memory doesn't require any additional handling of
the command packet.
Al
On 5/10/2012 1:48 AM, Fero Santos wrote: > Hello!
>
> Actually, it's not only 2 bytes.
>
> I was trying to interface a SPI with DMA...
> My operations are: send CMD (1byte), send ADDRESS (2 bytes) and send
> 1kByte.
> I tryed to make a step by step sending, but i think it will be better if i
> just concatenated CMD and ADDs bytes before my data and send it all as a
> block!
>
> Right?
>
> On Thu, Oct 4, 2012 at 12:19 PM, Onestone wrote:
>
>> **
>> Why would you need to do this? Possible solutions I can think of depend
>> on the rationale. if you actually only need to send 2 bytes then
>> obviously the DMA adds huge overhead.
>>
>> Al
>> On 5/10/2012 12:28 AM, favero.santos wrote:
>>> Hey, guys!
>>>
>>> Anyone knows if "block transfer" + "decrement source address" is a valid
>> operation in DMA?
>>> I'm trying to send the int 0x1011 as a block, but 0x10 must be sent
>> prior to 0x11.
>>> I thought maybe this would work fine, but up to now, nothing....
>>>
>>> Any suggestions?
>>>
>>> DMA0CTL |= DMA0TSEL_0;
>>>
>>> /* PASSO 2*/
>>> //unsigned int endereco = 0x0000;
>>> DMA0CTL |= DMASRCINCR_2 + DMADSTINCR_3 + DMADT_1 + DMASBDB;
>>> // DMASRCINCR_0 -> Incrementa endere de partida
>>> // DMADSTINCR_0 -> N incrementa endere de chegada
>>> // DMADT_1 -> Modo bloco
>>> // DMASBDB -> Transfercia byte para byte
>>>
>>> DMA0SA = (int)&endereco+1;
>>> // Endere de partida o endere da variel endere
>>> DMA0DA = 0x1500; //(unsigned char)&UCB0TXBUF;
>>> // Endere de chegada o buffer de transmiss SPI
>>> DMA0SZ = 2;
>>> // Configura tamanho da transfercia - endere de 2 bytes
>>> DMA0CTL |= DMAEN + DMAREQ;
>>> // Enable para transfercia
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
Reply by Hugo Brunert●October 4, 20122012-10-04
Thank you
-----Original Message-----
From: m... [mailto:m...] On Behalf Of Fero Santos
Sent: Thursday, October 04, 2012 12:36 PM
To: m...
Subject: Re: [msp430] Re: MSP430F2619 DMA block transfer
Hello, Hugo
Deppends on timming diagram of your SPI component. I'm interfacing my MSP
with a 23k256 (32k bytes SPI RAM).
This memory only needs CMD + ADDRs + DATA.
For this memory, you can write the status register, in this case you'll use
only CMD+DATA.
Cheers!
On Thu, Oct 4, 2012 at 1:31 PM, Hugo Brunert wrote:
> **
> I may be wrong, but I thought you needed STATUS in between CMD & ADDRs
> & data.
>
> At least I use it. Am I wasting time by using status en between each Xfer?
>
> From: m... [mailto:m...] On Behalf
> Of favero.santos
> Sent: Thursday, October 04, 2012 12:27 PM
> To: m...
> Subject: [msp430] Re: MSP430F2619 DMA block transfer
> Hello, Felipe.
>
> Nice to find another brazilian in this forum.
>
> DMA0SA = (int)&endereco+1;
> this means DMA should use as source address the next byte of the int
> endereco.
>
> Example:
> int endereco 0x2010.
> In memory, it will be stored as:
> 0x10 0x20.
> Writing the cmd as i did, 0x20 will be pointed firstly (if DMA0SA =
> (int)&endereco, 0x10 will be pointed firstly).
>
> Anyway, i found another solution:
>
> I'll make a block of CMD (1byte) + ADDS (2 bytes) + data (1k byte) and
> send as an unique block (the way first way was sending with DMA
> separated
> blocks!)
>
> Cheers!
>
> --- In m... , Luis
> Rossi wrote:
> >
> > But what is the problem? Wrong data at SPI port, or no data at all?
> > Still you are going to have a problem with your trigger as it wont
> > wait untill the SPI TX buffer is empty to send the new data.
> >
> > And what is the meaning of this cast?
> >
> > DMA0SA = (int)&endereco+1;
> >
> > Regards,
> >
> > --
> > Lu Filipe Rossi
> > Electrical Engineer
> > Biomechatronics Lab. / Grupo de Sensores Integreis e Sistemas
> > Escola Politnica Universidade de S Paulo Cel. +55 (11) 7662-9234
> >
> >
> >
> >
>
>
>
Reply by ●October 4, 20122012-10-04
Hello, Hugo
Deppends on timming diagram of your SPI component. I'm interfacing my
MSP
with a 23k256 (32k bytes SPI RAM).
This memory only needs CMD + ADDRs + DATA.
For this memory, you can write the status register, in this case you'll
use
only CMD+DATA.
Cheers!
On Thu, Oct 4, 2012 at 1:31 PM, Hugo Brunert wrote:
> **
> I may be wrong, but I thought you needed STATUS in between CMD & ADDRs &
> data.
>
> At least I use it. Am I wasting time by using status en between each Xfer?
>
> From: m... [mailto:m...] On Behalf Of
> favero.santos
> Sent: Thursday, October 04, 2012 12:27 PM
> To: m...
> Subject: [msp430] Re: MSP430F2619 DMA block transfer
> Hello, Felipe.
>
> Nice to find another brazilian in this forum.
>
> DMA0SA = (int)&endereco+1;
> this means DMA should use as source address the next byte of the int
> endereco.
>
> Example:
> int endereco 0x2010.
> In memory, it will be stored as:
> 0x10 0x20.
> Writing the cmd as i did, 0x20 will be pointed firstly (if DMA0SA =
> (int)&endereco, 0x10 will be pointed firstly).
>
> Anyway, i found another solution:
>
> I'll make a block of CMD (1byte) + ADDS (2 bytes) + data (1k byte) and
> send as an unique block (the way first way was sending with DMA separated
> blocks!)
>
> Cheers!
>
> --- In m... , Luis
> Rossi wrote:
> >
> > But what is the problem? Wrong data at SPI port, or no data at all? Still
> > you are going to have a problem with your trigger as it wont wait untill
> > the SPI TX buffer is empty to send the new data.
> >
> > And what is the meaning of this cast?
> >
> > DMA0SA = (int)&endereco+1;
> >
> > Regards,
> >
> > --
> > Lu Filipe Rossi
> > Electrical Engineer
> > Biomechatronics Lab. / Grupo de Sensores Integreis e Sistemas
> > Escola Politnica
> > Universidade de S Paulo
> > Cel. +55 (11) 7662-9234
> >
> >
> >
> >
>
>
>