mcf5329-> write in the data bus

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

mcf5329-> write in the data bus

2,865件の閲覧回数
VeronicaFNX
Contributor I
Hello,
 
i have an mcf5329evb and i want to write and/or to read in the data bus D[31:0].
 
I don't know how to do it. I believe that it is through flexbus but i'm not sure.
 
As it is the code to do this? (I would like an example).
 
Thanks
 
   Veronica
ラベル(1)
0 件の賞賛
返信
5 返答(返信)

1,350件の閲覧回数
VeronicaFNX
Contributor I
Please, somebody can say something to me?
 
I need aid. Thanks
 
Veronica
0 件の賞賛
返信

1,350件の閲覧回数
w_wegner
Contributor III
Hi,

I can try to help you, but 1. I did not try this myself, and 2. I do not know which devices are present on the MCF5329EVB.

I am not sure what you mean by "reading and writing the data bus". As you write about D[31:0], I guess the MCF5329EVB uses shared bus mode with non-DDR SDRAM connected to the whole data bus? In any case, you need a chip select signal to determine if any other device on the bus or your "port" is accessed.

The keyword chip select leads directly to Flexbus, which you have to set up. So the basic steps are:
1. select a chip select you want to use for the access, e.g. CS3
2. program the chip select address register (CSAR3, 0xFC00_8018 in our example) to a currently unused address in the range of 0x0000_0000–0x3FFF_FFFF or 0xC000_0000–0xDFFF_FFFF (these are the only allowed ranges according to the data sheet)
3. program CSMR3 to a proper value - if you just want to read one "value", you can set it to 0x0000_0001 (64k Range, R/W allowed, Valid)
4. program CSCR3 - this is probably the most difficult part, because you have to know what timing you need. For a simple start, you probably only need the lower 16 bits and van set the upper 16 bits to 0x0000. Also, if TA is not generated externally, remember to set AA and a proper value of WS. (My guess: use something like 0x0000XX00 (32bit bus-size) with XX being replaced by the proper values of WS and SBM=0 and AA=1. In case my above assumption was wrong and the EVB uses DDR SDRAM, use 0x0000XX80 and set SBM=1 - but in this case, you can only use 16bits of the data bus for this access!)

Then you should be able to access the "port" in the address region you programmed in CSAR3.

I hope this is what you wanted to know? :smileyhappy:

Regards, Wolfgang

Message Edited by WolfgangW on 2007-05-16 04:58 PM
0 件の賞賛
返信

1,350件の閲覧回数
VeronicaFNX
Contributor I
Thanks by the response but i have any questions yet.
 
1. I must configure CSAR3 with 0xFC00_8018 (for example) but the register only have bits [31:16] because the others are reserved. How can I do it?
 
2.- I don't understand so that the register CSMR3 is used. BAM (base addresss mask).
 
Thank you very much.
 
 Veronica
 
0 件の賞賛
返信

1,350件の閲覧回数
w_wegner
Contributor III
Sorry, this was not written clearly and wrong, too!

0xFC00_8018 should have been the address of CSAR3 - the correct address would be 0xFC00_8024... So you just write the desired address with the lower 16 bits masked out (set to zero) to CSAR3 (the location 0xFC00_8024).
Sorry for the confusion!

For the second part:
I am not sure if I understand (and thus can explain) the meaning of BAM correctly myself;
As far as I understand, you have to set the mask in case the address range for the Chip select is larger than 64kByte (16 Bits) or if you want to access the same range at different locations.

I.e., if your "device" does not decode any address lines (or less than the lower 16 lines), just set BAM to all zeroes and access it starting from the base address written to CSARx. If less than 16 address lines are decoded from your external device, accesses will "wrap around" at the highest possible address line until to the end of the 64 kByte address range. For example, if your device uses 2 address lines to decode 4 addresses, access to CSARx + 4 will give the same result as access to CSARx.
(Maybe a bad example, because decoding the lowest 2 address lines does not really make sense on a 32 bit processor - but I hope you get an idea what is meant.)

Regards,
Wolfgang
0 件の賞賛
返信

1,350件の閲覧回数
VeronicaFNX
Contributor I
Thanks.
 
I will try to do something yet this.
 
Veronica
0 件の賞賛
返信