problem of CS8900a operating in 8 bit mode

Hi all:

I have an board which nWBE(Write byte enable) connects nSBHE of cs8900a. It operates in 8 bit mode.Since cs8900a is in IO mode after resetting, I should read the relative internal register. But it seems that I cannot read the high byte. Datasheet of cs8900a says: it operates in 16-bit mode and it can be operates in 8 bit mode.But when I read the product identification., high 8 bits seems not to be read.

1)system data bus has been set as 8-bit mode:

*(volatile unsigned char *)(BASE_ADDR + 0x300 + 0xA) = 0x00; val = *(volatile unsigned char *)(BASE_ADDR + 0x300 + 0xC); /* val should be 0x0e. It is right.*/

*(volatile unsigned char *)(BASE_ADDR + 0X300 + 0xA) = 0x01; val = *(volatile unsigned char *)(BASE_ADDR + 0x300 + 0xD); /* val should be 0x63. but it is 0x0E */

2)system data bus has been set as 16-bit mode:

*(volatile unsigned short *)(BASE_ADDR + 0x300 + 0xA) = 0x0000; val = *(volatile unsigned short *)(BASE_ADDR + 0x300 + 0xC); /* val should be 0x630e.but it is 0xe10e */

I have read the AN181, but it seems not to give any clues how to operate the internal registers in 8-bit mode in IO mode.

Anybody have an idea??

Thanks in advance.

Michael

Reply to
Michael Liao
Loading thread data ...

The problem here is that you are changing both the register number, but also the part of the data port that you read from. You need to read from the same part of the data port (0xC) as before.

I'm not sure what is going on with your 16-bit example.

Reply to
Gary Kato

Now I see what is happening in 16-bit data bus mode. You are assuming that when you setup to read register 0, that you will get the contents of both register 0 and 1. What you get are register 0 and something else, either garbage or "register -1". Try reading register 1 and seeing if you get register 0 in one byte and register 1 in the other. It could be that you'll always get garbage in the high byte if the 8900a only access the ID one byte at a time.

Reply to
Gary Kato

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.