Sign in

username:

password:



Not a member?

Search AT91SAM



Search tips

Subscribe to AT91SAM



Ads

Discussion Groups

Discussion Groups | AT91SAM ARM | at91sam7 Reset routine

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.

at91sam7 Reset routine - wuerzi - Jul 23 11:20:44 2008

I have some problems with the software reset on an Atmel at91sam7s256
Controller, in principle it should work but if I change things that
have absolutely no visible connection to the reset controller it stops
working. To be more exact either it starts normal and works after a
reset or it stops working after a view lines of main and the whole
controller hangs. An example I have a configuration if the CSAAT-bit
in the SPI Chip Select register is set my reset routine doesn't work
and if not set it works. In case of a prober hardware reset there is
never a problem so it must be some differences between hard and
software reset.
I'm using the gcc compiler.
My code:

void RAMFUNC DoReset() {

// Execute a software reset of the SPI
AT91C_BASE_SPI->SPI_CR = AT91C_SPI_SWRST;
// Configure SPI in Master Mode with No CS selected !!!
AT91C_BASE_SPI->SPI_MR = (AT91C_SPI_MSTR | AT91C_SPI_MODFDIS |
AT91C_SPI_PCS);
// Fixed perpheral select, CS0
//SPI_BASE->SPI_MR = (AT91C_SPI_MSTR); // | AT91C_SPI_LLB); // Remove
LLB!
// Disable the PDC transfer
AT91C_BASE_SPI->SPI_PTCR = (AT91C_PDC_RXTDIS | AT91C_PDC_TXTDIS);
// Disable the SPI
AT91C_BASE_SPI->SPI_CR = AT91C_SPI_SPIDIS;
// Disable the SPI clock
AT91C_BASE_PMC->PMC_PCDR = (1 << AT91C_ID_SPI);

DisableAllInts();

// Disable PMC devices
AT91C_BASE_PMC->PMC_SCDR = 0xFFFFFFFF;

//AT91S_RSTC->RSTC_RCR=1;
//AT91C_RSTC->//_RCR=1;
AT91C_BASE_RSTC->RSTC_RCR = 0xA5000003; // Controller+Periph
}

Best regards
Marcus

------------------------------------



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