EmbeddedRelated.com
Forums

ADC & SPI Interrupts

Started by bigdog16_83 March 24, 2005

I am developing a system where I have to communicate through the SPI
with a flash (ATMEL AT45DB081B) based on what value I obtain on one of
my ADC12 ports. I am using the MSP430-149. Right now the system is set
up such that the ADC has its own interrupt and if a certain value is
hit  - it sends an opcode out the SPI (SIMO) to the flash. This ends
the ADC interrupt. The opcode though tells the flash to start
continuously sending data to the MSP through the SOMI pin. I then have
a SPI RX interrupt set up to take care of these bytes coming in. I
have the adc set to repeatedly read the same channel and I have gotten
that to work. I cannot get the SPI transfer to work. It seems to be
transfering 1 byte each time the adc interrupts like maybe my
interrupts are conflicting. Is this possible?

Any help would be greatly appreciated. I basically need to get the SPI
interrupt to due something every time it recieves a byte - independent
of teh ADC interrupt. The main program though is just to poll the ADC
for changes that tell me when I want to start the data transfer from
the  flash. 







Beginning Microcontrollers with the MSP430

Hi,

there are no conflicts.
I'm using the MSP430F149 with SPI (to MMC/SDC), ADC,
second UART, timer and button-generated irqs without problems.

Regards,

Rolf


msp430@msp4... schrieb am 24.03.05 06:33:43:
> 
> 
> 
> 
> I am developing a system where I have to communicate through the SPI
> with a flash (ATMEL AT45DB081B) based on what value I obtain on one of
> my ADC12 ports. I am using the MSP430-149. Right now the system is set
> up such that the ADC has its own interrupt and if a certain value is
> hit  - it sends an opcode out the SPI (SIMO) to the flash. This ends
> the ADC interrupt. The opcode though tells the flash to start
> continuously sending data to the MSP through the SOMI pin. I then have
> a SPI RX interrupt set up to take care of these bytes coming in. I
> have the adc set to repeatedly read the same channel and I have gotten
> that to work. I cannot get the SPI transfer to work. It seems to be
> transfering 1 byte each time the adc interrupts like maybe my
> interrupts are conflicting. Is this possible?
> 
> Any help would be greatly appreciated. I basically need to get the SPI
> interrupt to due something every time it recieves a byte - independent
> of teh ADC interrupt. The main program though is just to poll the ADC
> for changes that tell me when I want to start the data transfer from
> the  flash. 
> 
> 
> 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 




Those most of what I am using. I use the ADC, SPI, and the other UART.
Could you maybe show me how you initialized all that - maybe I am
missing something. thanks

--- In msp430@msp4..., <rolf.freitag@e...> wrote:
> Hi,
> 
> there are no conflicts.
> I'm using the MSP430F149 with SPI (to MMC/SDC), ADC,
> second UART, timer and button-generated irqs without problems.
> 
> Regards,
> 
> Rolf
> 
> 
> msp430@msp4... schrieb am 24.03.05 06:33:43:
> > 
> > 
> > 
> > 
> > I am developing a system where I have to communicate through the SPI
> > with a flash (ATMEL AT45DB081B) based on what value I obtain on one of
> > my ADC12 ports. I am using the MSP430-149. Right now the system is set
> > up such that the ADC has its own interrupt and if a certain value is
> > hit  - it sends an opcode out the SPI (SIMO) to the flash. This ends
> > the ADC interrupt. The opcode though tells the flash to start
> > continuously sending data to the MSP through the SOMI pin. I then have
> > a SPI RX interrupt set up to take care of these bytes coming in. I
> > have the adc set to repeatedly read the same channel and I have gotten
> > that to work. I cannot get the SPI transfer to work. It seems to be
> > transfering 1 byte each time the adc interrupts like maybe my
> > interrupts are conflicting. Is this possible?
> > 
> > Any help would be greatly appreciated. I basically need to get the SPI
> > interrupt to due something every time it recieves a byte - independent
> > of teh ADC interrupt. The main program though is just to poll the ADC
> > for changes that tell me when I want to start the data transfer from
> > the  flash. 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > .
> > 
> >  
> > Yahoo! Groups Links
> > 
> > 
> > 
> >  
> > 
> > 
> >




Hi,

i simply do initialize all ports, the uarts, 
oscillators, timers, ADC etc. at the start of main.
You can find a simple example with spi, which initializes
only the used pins, here:

http://www.random.linux-site.net/files/unsorted/kartenleser_ti/

For more you have to pay some bucks ...

Regards,

Rolf


msp430@msp4... schrieb am 24.03.05 18:26:45:
> 
> 
> 
> Those most of what I am using. I use the ADC, SPI, and the other UART.
> Could you maybe show me how you initialized all that - maybe I am
> missing something. thanks
> 
> --- In msp430@msp4..., <rolf.freitag@e...> wrote:
> > Hi,
> > 
> > there are no conflicts.
> > I'm using the MSP430F149 with SPI (to MMC/SDC), ADC,
> > second UART, timer and button-generated irqs without problems.
> > 
> > Regards,
> > 
> > Rolf
> > 
> > 
> > msp430@msp4... schrieb am 24.03.05 06:33:43:
> > > 
> > > 
> > > 
> > > 
> > > I am developing a system where I have to communicate through the
SPI
> > > with a flash (ATMEL AT45DB081B) based on what value I obtain on
one of
> > > my ADC12 ports. I am using the MSP430-149. Right now the system
is set
> > > up such that the ADC has its own interrupt and if a certain value
is
> > > hit  - it sends an opcode out the SPI (SIMO) to the flash. This
ends
> > > the ADC interrupt. The opcode though tells the flash to start
> > > continuously sending data to the MSP through the SOMI pin. I then
have
> > > a SPI RX interrupt set up to take care of these bytes coming in.
I
> > > have the adc set to repeatedly read the same channel and I have
gotten
> > > that to work. I cannot get the SPI transfer to work. It seems to
be
> > > transfering 1 byte each time the adc interrupts like maybe my
> > > interrupts are conflicting. Is this possible?
> > > 
> > > Any help would be greatly appreciated. I basically need to get
the SPI
> > > interrupt to due something every time it recieves a byte -
independent
> > > of teh ADC interrupt. The main program though is just to poll the
ADC
> > > for changes that tell me when I want to start the data transfer
from
> > > the  flash. 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > .
> > > 
> > >  
> > > Yahoo! Groups Links
> > > 
> > > 
> > > 
> > >  
> > > 
> > > 
> > >
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
>