cancel
Showing results for 
Search instead for 
Did you mean: 

Generating CSx

sadhana
Associate II
Posted on February 18, 2005 at 04:20

Generating CSx

10 REPLIES 10
sadhana
Associate II
Posted on February 11, 2005 at 13:15

Problem statement:

I plan to use CS0, CS1 and CS2 in my target system. The external memory is connected to CS0 and is addressed at 0x100000 of 1024KBytes. I've only A0 to A20 lines from CPU, as I want to use CAN too in my system (A21 is CAN1 Rx).

Now I set ADDRSEL1 to 0x0800 with BUSCON1 = 0x4ae and ADDRSEL2 to 0x0900 with BUSCON2 = 0x4ae. I map an array at location 0x80000 and another at 0x90000. But when i access both of them, I get only CS1 low and CS2 is continuous high.

Can anybody explain exactly whats expected from user while setting these ADDRSELx registers?

:(

michele239955
Associate II
Posted on February 14, 2005 at 09:37

Mmmm. I read your question but I found something strange.

First of all, which device are you using?

You say you want to use three chip select lines. I guess you phisically have three memory banks. Have you configured properly RPOH register? To use CS0,CS1 and CS2 lines you have to set CSSEL in 00 or 11 configuration (also CS3 and CS4) . Moreover you cannot use an arbitrary number of P4 lines, for example if you want to have 1Mbytes of address space and you want to use CAN you have to choose 00 configuration for SALSEL (A0...A19). In that way, using three CS signals you can address up to 3 Mbytes (or 5 Mbytes with 5 CS).

Regarding ADDRSELx I want to remind you that there is a kind of priority. The window selected by ADDRSEL2 has more priority than the window selected by ADDRSEL1 and all other space is managed by CS0.

So for istance, you can create three windows (1Mega size) completely separated in this way:

2)Set ADDRSEL1=0x1008 (1mega starting from 0x100000), CS1 will be low in this window.

2)Set ADDRSEL2=0x2008 (1mega starting from 0x200000), CS2 will be low in this window.

Set BUSCON0, BUSCON1 and BUSCON2 according to the carachteristics of your memory. All the space that is not managed by CS1 and CS2 is assigned to CS0 (first megabyte).

You can also set ADDRSEL1 and ADDRSEL2 setting ADDRSEL1=0x0805 (128K starting from 0x080000) and ADDRSEL2=0x0904 (64K starting from 0x090000). The lowest nibble of ADDRSELx specifies the window size, 0 identifies 4K size. Note that ADDRSEL2 overlaps ADDRSEL1. As before all the remaining addressable space is managed by CS0.

Remember also that setting in BUSCONx CSRENx=0 and CSWENx=0, ''..address chip select signals remain active until an access to another address window. An address chip

select becomes active with the falling edge of ALE and becomes inactive with the falling edge of ALE of an external bus cycle that accesses a different address area.''

sadhana
Associate II
Posted on February 15, 2005 at 06:28

We are using ST10F269.

We have configured RP0H such that we can use all 5 CSx signals. Actually we require to generate 4 CSx but there is no configuration available to select only 4 CSx.

Though we have used only A0-A19 lines for external memory of size 1MB, A20 line is used for memory window selection with starting address 0x100000.

CS1 and CS2 we want to generate for memory mapped IOs which we intend to access at any address to which CS1 and CS2 gets activated. And My question was for the same. As I was not able to successfully generate these signals.

Thanks for your inputs. I shall once again try and get back if problem still persist.

michele239955
Associate II
Posted on February 15, 2005 at 07:58

Just one curiosity. Have you tried to use CS3 or CS4 instead of CS2?

sadhana
Associate II
Posted on February 15, 2005 at 11:09

I tried generating CS3 and CS1, but not yet tried CS4.

michele239955
Associate II
Posted on February 15, 2005 at 11:59

Excuse me the trivial question, but are you trying to get two CSx signals low at the same time? It is not clear...

sadhana
Associate II
Posted on February 15, 2005 at 12:26

Not at all. Only one at a time!

Sorry for not being clear in previous reply.

Can you tell me if you have any application note on the external memory interface, for ST10F269?

michele239955
Associate II
Posted on February 16, 2005 at 07:18

No, I'm sorry I haven't got any application notes on that.

Anyway I tried two CSx signals, Now I have external memory on CS1 in the first megabytes, and I put a window at 0x0A0xxx ADRSEL2=0x0A00, micro is F296 and it works, CS2 goes down when required.

sadhana
Associate II
Posted on February 17, 2005 at 02:02

Thanks for that input. May I pls request you to send your workspace in which the things are working?