Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: urgency!! problem with AT91SAM9260
PostPosted: Mon Aug 13, 2007 3:26 pm 
Offline

Joined: Mon Aug 13, 2007 1:43 pm
Posts: 1
Location: shenzhen special district,Guangdong province,China
I have a problem with AT91SAM9260
I'm a newbie of embedded software engineer,and know very little about hardware knowledge.
We have bought one AT91SAM9260-EK board,and buid our board the same with AT91SAM9260-EK
except that the nand flash which was replaced with our KH29LV640DT-B (4M x 16bit) NOR
FLASH.Our NorFlash is 16 bit data bus.

We use AT91SAM9260 NCS6 for the Nor Flash chip select, and the NCS6 bank address is
0x7000 0000. and NCS6 is pin A13(signal name is pc13,that is PIO Controller C 13 pin)'s
peripheral B function.

We use pin A13(signal name is pc13) for our NorFlash's CE#.
We can load and run the U-boot correctly in our board,But we always get the WRONG NorFlash's
Manufacturer ID and Device ID.This is my problem.
I have turned to our hardware engineer,and he is sure that the circuit of the board is

right.
The right Manufacturer ID and Device ID is the same 0xC2, but we always get 0xc.

Below is the main source code of the NorFlash:

#define AT91C_SM_NWE_SETUP (0 << 0)
#define AT91C_SM_NCS_WR_SETUP (0 << 8)
#define AT91C_SM_NRD_SETUP (0 << 16)
#define AT91C_SM_NCS_RD_SETUP (0 << 24)
#define AT91C_SM_NWE_PULSE (5 << 0) //lingyb Write
#define AT91C_SM_NCS_WR_PULSE (7 << 8) //lingyb cs Write
#define AT91C_SM_NRD_PULSE (5 << 16) //lingyb Read
#define AT91C_SM_NCS_RD_PULSE (7 << 24) //lingyb cs Read
#define AT91C_SM_NWE_CYCLE (12 << 0) //lingyb Write
#define AT91C_SM_NRD_CYCLE (12 << 16) //lingyb Read
#define AT91C_SM_TDF (1 << 16)

#define FLASH_BASE 0x70000000
typedef volatile unsigned char vu_char;

unsigned long nor_init (void)
{
vu_char* addr;

/* Configure SMC CS6 */
AT91C_BASE_SMC->SMC_SETUP6 = (AT91C_SM_NWE_SETUP | AT91C_SM_NCS_WR_SETUP |
AT91C_SM_NRD_SETUP | AT91C_SM_NCS_RD_SETUP);

AT91C_BASE_SMC->SMC_PULSE6 = (AT91C_SM_NWE_PULSE | AT91C_SM_NCS_WR_PULSE |
AT91C_SM_NRD_PULSE | AT91C_SM_NCS_RD_PULSE);

AT91C_BASE_SMC->SMC_CYCLE6 = (AT91C_SM_NWE_CYCLE | AT91C_SM_NRD_CYCLE);

AT91C_BASE_SMC->SMC_CTRL6 = (AT91C_SMC_READMODE | AT91C_SMC_WRITEMODE |
AT91C_SMC_NWAITM_NWAIT_DISABLE |
AT91C_SMC_DBW_WIDTH_SIXTEEN_BITS | AT91C_SM_TDF);

/* enable the nor flash chip select */
AT91C_BASE_PIOC->PIO_PDR = AT91C_PIO_PC13;
AT91C_BASE_PIOC->PIO_BSR = AT91C_PIO_PC13;

printf("AT91C_BASE_PIOC->PIO_ABSR & AT91C_PIO_PC13=0x%x \n\r",AT91C_BASE_PIOC->PIO_ABSR &

AT91C_PIO_PC13);//lingyb
printf("AT91C_BASE_PIOC->PIO_PSR & AT91C_PIO_PC13=0x%x \n\r",AT91C_BASE_PIOC->PIO_PSR &

AT91C_PIO_PC13 );//lingyb

/* get manufacturer ID and device ID */
addr = (vu_char*)FLASH_BASE;
addr[0x555] = 0xAA;
addr[0x2aa] = 0x55;
addr[0x555] = 0x90;
ID_manuf = (ulong)addr[0];
ID_device = (ulong)addr[1];
/* restore read mode */
addr[0x0000] = 0xF0;

printf("Manuf. ID @ 0x%08lx: 0x%08lx\n", (ulong)addr, ID_manuf);
printf("Device ID @ 0x%08lx: 0x%08lx\n", (ulong)(&addr[1]), ID_device);

}

I don't known where is wrong. Is it that any step I didn't execute ? or that the timings of

SMC_PULSE6 and SMC_CYCLE6
is wrong? I have try lot's of SMC_PULSE6 and SMC_CYCLE6 timings combinations,but still get

the wrong 0xC Manufacturer ID.
Can anyone help me? I will really really very much appreciate for you!!
Thank you,Thank you very much in advance.


Top
 Profile  
 
 Post subject: Re: urgency!! problem with AT91SAM9260
PostPosted: Fri Sep 26, 2008 9:34 am 
Offline

Joined: Mon May 28, 2007 5:02 pm
Posts: 50
Location: Walton-on-Thames, UK
I think your problem may be the addresses that you are using.
The Flash expects to see addresses 555 2aa 555. Because you are 16 bits wide A0 is not used and A0 of the fllash is on A1 of the processor. Therefore may be the addresses in your software should be aaa 554 aaa ???


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron