For users of the Atmel AT91SAM7 and AT91SAM9 ARM CPU chips. Atmel has taken a new direction by combining on chip flash and ram with the ARM CPU on a single die. This provides low cost devices for small systems using the ARM CPU.
This group is to exchange information to help users get started and learn how to use the devices.
spi pdc aic interupt - gamerz267 - Jan 23 21:31:09 2008
i need some help with using aic with pdc. How do you initiate it. This
is how i set it up.
// Configure interupt when End of Transfer
AT91F_SPI_EnableIt(pSPI, AT91C_SPI_ENDTX);
// Configure the AIC for SPI interrupts
AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI0,
AT91C_AIC_PRIOR_HIGHEST, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, SPI0_Handler);
// Enable the interrupt on the interrupt controller
AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI0);

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: spi pdc aic interupt - Eric Pasquier - Jan 24 5:33:17 2008
Hi,
Did you set the peripheral clock (PMC_PCER) ?
Eric.
----- Original Message -----
From: gamerz267
To: A...@yahoogroups.com
Sent: Thursday, January 24, 2008 3:28 AM
Subject: [AT91SAM] spi pdc aic interupt
i need some help with using aic with pdc. How do you initiate it. This
is how i set it up.
// Configure interupt when End of Transfer
AT91F_SPI_EnableIt(pSPI, AT91C_SPI_ENDTX);
// Configure the AIC for SPI interrupts
AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI0,
AT91C_AIC_PRIOR_HIGHEST, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, SPI0_Handler);
// Enable the interrupt on the interrupt controller
AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI0);

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: spi pdc aic interupt - gamerz267 - Jan 24 17:37:27 2008
Do you mean this
AT91F_PMC_EnablePeriphClock(
AT91C_BASE_PMC, // PIO controller base address
((unsigned int) 1 << AT91C_ID_SPI0));
// from lib_AT91SAM7X256.h
void AT91F_PMC_EnablePeriphClock (
AT91PS_PMC pPMC, // \arg pointer to PMC controller
unsigned int periphIds) // \arg IDs of peripherals
{
pPMC->PMC_PCER = periphIds;
}
--- In A...@yahoogroups.com, "Eric Pasquier"
wrote:
>
> Hi,
>
> Did you set the peripheral clock (PMC_PCER) ?
>
> Eric.
> ----- Original Message -----
> From: gamerz267
> To: A...@yahoogroups.com
> Sent: Thursday, January 24, 2008 3:28 AM
> Subject: [AT91SAM] spi pdc aic interupt
> i need some help with using aic with pdc. How do you initiate it. This
> is how i set it up.
>
> // Configure interupt when End of Transfer
> AT91F_SPI_EnableIt(pSPI, AT91C_SPI_ENDTX);
>
> // Configure the AIC for SPI interrupts
> AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI0,
> AT91C_AIC_PRIOR_HIGHEST, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL,
SPI0_Handler);
>
> // Enable the interrupt on the interrupt controller
> AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI0);
>

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Re: spi pdc aic interupt - Eric Pasquier - Jan 25 3:57:42 2008
Yes.
You have to set the internal MCK clock for each peripheral, disconnected by default for
lower consumption.
And, of course, you have to set others parmeters like number of bits, transfer rate, ...
depending of your application.
Eric Pasquier
----- Original Message -----
From: gamerz267
To: A...@yahoogroups.com
Sent: Thursday, January 24, 2008 11:24 PM
Subject: [AT91SAM] Re: spi pdc aic interupt
Do you mean this
AT91F_PMC_EnablePeriphClock(
AT91C_BASE_PMC, // PIO controller base address
((unsigned int) 1 << AT91C_ID_SPI0));
// from lib_AT91SAM7X256.h
void AT91F_PMC_EnablePeriphClock (
AT91PS_PMC pPMC, // \arg pointer to PMC controller
unsigned int periphIds) // \arg IDs of peripherals
{
pPMC->PMC_PCER = periphIds;
}
--- In A...@yahoogroups.com, "Eric Pasquier"
wrote:
>
> Hi,
>
> Did you set the peripheral clock (PMC_PCER) ?
>
> Eric.
>
>
> ----- Original Message -----
> From: gamerz267
> To: A...@yahoogroups.com
> Sent: Thursday, January 24, 2008 3:28 AM
> Subject: [AT91SAM] spi pdc aic interupt
>
>
> i need some help with using aic with pdc. How do you initiate it. This
> is how i set it up.
>
> // Configure interupt when End of Transfer
> AT91F_SPI_EnableIt(pSPI, AT91C_SPI_ENDTX);
>
> // Configure the AIC for SPI interrupts
> AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI0,
> AT91C_AIC_PRIOR_HIGHEST, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL,
SPI0_Handler);
>
> // Enable the interrupt on the interrupt controller
> AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI0);
>

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: spi pdc aic interupt - gamerz267 - Jan 26 22:09:13 2008
ok the clock was already enabled. Do i have to enable it for the aic too?
If so how do i do that?
--- In A...@yahoogroups.com, "Eric Pasquier"
wrote:
>
> Yes.
> You have to set the internal MCK clock for each peripheral,
disconnected by default for lower consumption.
>
> And, of course, you have to set others parmeters like number of
bits, transfer rate, ... depending of your application.
>
> Eric Pasquier
> ----- Original Message -----
> From: gamerz267
> To: A...@yahoogroups.com
> Sent: Thursday, January 24, 2008 11:24 PM
> Subject: [AT91SAM] Re: spi pdc aic interupt
> Do you mean this
>
> AT91F_PMC_EnablePeriphClock(
> AT91C_BASE_PMC, // PIO controller base address
> ((unsigned int) 1 << AT91C_ID_SPI0));
>
> // from lib_AT91SAM7X256.h
> void AT91F_PMC_EnablePeriphClock (
> AT91PS_PMC pPMC, // \arg pointer to PMC controller
> unsigned int periphIds) // \arg IDs of peripherals
> {
> pPMC->PMC_PCER = periphIds;
> }
>
> --- In A...@yahoogroups.com, "Eric Pasquier" wrote:
> >
> > Hi,
> >
> > Did you set the peripheral clock (PMC_PCER) ?
> >
> > Eric.
> >
> >
> > ----- Original Message -----
> > From: gamerz267
> > To: A...@yahoogroups.com
> > Sent: Thursday, January 24, 2008 3:28 AM
> > Subject: [AT91SAM] spi pdc aic interupt
> >
> >
> > i need some help with using aic with pdc. How do you initiate
it. This
> > is how i set it up.
> >
> > // Configure interupt when End of Transfer
> > AT91F_SPI_EnableIt(pSPI, AT91C_SPI_ENDTX);
> >
> > // Configure the AIC for SPI interrupts
> > AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI0,
> > AT91C_AIC_PRIOR_HIGHEST, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL,
> SPI0_Handler);
> >
> > // Enable the interrupt on the interrupt controller
> > AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI0);
>

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: spi pdc aic interupt - gamerz267 - Jan 27 17:21:32 2008
is there some special trick to get the interrupt working with spi. My
code doesnt cause a interupt. Am i doing something wrong??
AT91F_PMC_EnablePeriphClock(
AT91C_BASE_PMC, // PIO controller base address
((unsigned int) 1 << AT91C_ID_SPI0));
// Open PIO for SPI0
//AT91F_SPI0_CfgPIO();
AT91F_PIO_CfgPeriph(
AT91C_BASE_PIOA, // PIO controller base address
((unsigned int) AT91C_PA15_SPI0_NPCS3) |
((unsigned int) AT91C_PA16_SPI0_MISO) |
((unsigned int) AT91C_PA17_SPI0_MOSI) |
((unsigned int) AT91C_PA18_SPI0_SPCK), // Peripheral A
0); // Peripheral B
/*2. Configure interrupt for SPI0 in AIC*/
//AT91F_AIC_DisableIt(AT91C_BASE_AIC, AT91C_ID_SPI0);
// Configure the AIC for SPI interrupts
AT91F_AIC_ConfigureIt(
AT91C_BASE_AIC,
AT91C_ID_SPI0,
AT91C_AIC_PRIOR_HIGHEST,
AT91C_AIC_SRCTYPE_HIGH_LEVEL,
AT91F_SPI0_Interrupt_handler);
// Enable the interrupt on the interrupt controller
AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI0);
/*3. Configuration SPI*/
// Reset SPI
//AT91F_SPI_Reset(AT91C_BASE_SPI0);
// Configure SPI in Master Mode with with cs
AT91F_SPI_CfgMode(AT91C_BASE_SPI0, SPI_MODE);
// Configure CSx
AT91F_SPI_CfgCs(AT91C_BASE_SPI0, 3, SPI_NPCS3_CONFIG); //CS3
// Configure interupt when End of Transfer
AT91F_SPI_EnableIt(AT91C_BASE_SPI0, AT91C_SPI_TDRE);
// SPI_Enable
AT91F_SPI_Enable(AT91C_BASE_SPI0);
--- In A...@yahoogroups.com, "gamerz267"
wrote:
>
> ok the clock was already enabled. Do i have to enable it for the aic
too?
> If so how do i do that?
> --- In A...@yahoogroups.com, "Eric Pasquier" wrote:
> >
> > Yes.
> > You have to set the internal MCK clock for each peripheral,
> disconnected by default for lower consumption.
> >
> > And, of course, you have to set others parmeters like number of
> bits, transfer rate, ... depending of your application.
> >
> > Eric Pasquier
> >
> >
> > ----- Original Message -----
> > From: gamerz267
> > To: A...@yahoogroups.com
> > Sent: Thursday, January 24, 2008 11:24 PM
> > Subject: [AT91SAM] Re: spi pdc aic interupt
> >
> >
> > Do you mean this
> >
> > AT91F_PMC_EnablePeriphClock(
> > AT91C_BASE_PMC, // PIO controller base address
> > ((unsigned int) 1 << AT91C_ID_SPI0));
> >
> > // from lib_AT91SAM7X256.h
> > void AT91F_PMC_EnablePeriphClock (
> > AT91PS_PMC pPMC, // \arg pointer to PMC controller
> > unsigned int periphIds) // \arg IDs of peripherals
> > {
> > pPMC->PMC_PCER = periphIds;
> > }
> >
> > --- In A...@yahoogroups.com, "Eric Pasquier" wrote:
> > >
> > > Hi,
> > >
> > > Did you set the peripheral clock (PMC_PCER) ?
> > >
> > > Eric.
> > >
> > >
> > > ----- Original Message -----
> > > From: gamerz267
> > > To: A...@yahoogroups.com
> > > Sent: Thursday, January 24, 2008 3:28 AM
> > > Subject: [AT91SAM] spi pdc aic interupt
> > >
> > >
> > > i need some help with using aic with pdc. How do you initiate
> it. This
> > > is how i set it up.
> > >
> > > // Configure interupt when End of Transfer
> > > AT91F_SPI_EnableIt(pSPI, AT91C_SPI_ENDTX);
> > >
> > > // Configure the AIC for SPI interrupts
> > > AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI0,
> > > AT91C_AIC_PRIOR_HIGHEST, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL,
> > SPI0_Handler);
> > >
> > > // Enable the interrupt on the interrupt controller
> > > AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI0);
> > >
>

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: spi pdc aic interupt - gamerz267 - Jan 28 1:38:24 2008
do i have it init it in start file to work??
something like this?? the startup file i have do have this...
/* Initialize AIC
****************/
AT91C_BASE_AIC->AIC_IDCR = 0xFFFFFFFF;
AT91C_BASE_AIC->AIC_SVR[0] = (unsigned int) defaultFiqHandler;
for (i = 1; i < 31; i++) {
AT91C_BASE_AIC->AIC_SVR[i] = (unsigned int) defaultIrqHandler;
}
AT91C_BASE_AIC->AIC_SPU = (unsigned int) defaultSpuriousHandler;
// Unstack nested interrupts
for (i = 0; i < 8 ; i++) {
AT91C_BASE_AIC->AIC_EOICR = 0;
}
--- In A...@yahoogroups.com, "gamerz267"
wrote:
>
> i need some help with using aic with pdc. How do you initiate it. This
> is how i set it up.
>
> // Configure interupt when End of Transfer
> AT91F_SPI_EnableIt(pSPI, AT91C_SPI_ENDTX);
>
> // Configure the AIC for SPI interrupts
> AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SPI0,
> AT91C_AIC_PRIOR_HIGHEST, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL,
SPI0_Handler);
>
> // Enable the interrupt on the interrupt controller
> AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SPI0);
>

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