AT89S5253 SPI Problem

Hello,

I am using an Atmel AT89S8253 MCU with the W5100 controller via SPI.
Although software (bit-banging) SPI does work, I cannot use the integrated hardware SPI of the 89S8253.
I’ve tried all modes, but even mode 0 does not work, reducing the ISP-Speed didn’t work either.
On the other hand, I can drive SD-Cards and a 128x160 TFT-Display at full speed (12Mhz SPI-clock) without any problems in the same circuit.

Has anyone else got similar problems?

Regards,
Roland

Hi,

It seems to have another problem because other device do work well but W5100 doesn’t.

Did you check the signal integrity of SPI interface using Oscilloscope?
Can I show the wave measured by oscilloscope?

Hi,
I own a 20 MHz 2-channel analog scope,
but don’t think that I can make good enough pictures of the waves.
What signals would you like to see? Sck vs. Mosi and CS vs. Sck?
Before I used hardeware SPI inside the 89S8253 with SD-Card, display and w5100, I used
only software SPI with an Atmel 89S82 and dicovered that I had to
adjust my SPI routine specially for the w5100. Although all components claim
to expect mode 0. And I programmed mode 0 for SD and display before I tried the w5100.
Since software SPI is quite slow it can’t be a real timing problem.
It is more a problem when each signal has to be asserted in general. (IMHO)
Hat do you think about it ? Can I contact Wiznet about this somehow?
Cheers, Roland

Hi,
I believed what you said about SPI signal integrity.
But, I hope that you check Master’s SPI output singals to output Hi-Z. If Hi-Z is output, Pull up with register about 4.7K.

First, Check Reset low time over 2us, and then wait for 10ms(wait unitl internal PLOCK is high).
If SPI WR/RD with OPCODE, 2bytes ADDR, DATA is normal operated , You can read 0x00,0x01,0x02 and 0x03(data, when OP=RD) from MISO respectly.

And, If you want to use multiful SPI slaves, Be careful for control to both /SCS and SEN signal.

For more detail information, Refer to [url]http://www.wiznet.co.kr/UpLoad_Files/ReferenceFiles/W5100_AN_SPI.pdf[/url].

Hi,
I use an Arduino Ethernet-Shield that has an inverter for /CS → SEN.
So the reqs of that AN should be met.
It’s a pity the shield also uses a resistor network for adjusting voltage
to 3.3V, but I have alread checked the voltage levels and waves, which seemed all right to me.
But I am going to check it again…
I used the 00 01 02 03 - scheme writing to the w5100 for debugging of the soft-SPI-routine.
Thanks, Roland

Hi,
I’m sorry that I don’t know that you applied already with AN guide.

In the case that hardware have no problem,
First,
Verify read operaion with RTR register.

… OP… ADDRH … ADDRL … DATA … OP … ADDRH … ADDRL … DATA
MOSI … 0x0F … 0x00 … 0x17 … Any … 0x0F … 0x00 … 0x18 … Any
MISO … 0x00 … 0x01 … 0x02 … 0x07 … 0x00 … 0x01 … 0x02 … 0xD0

Check that MOSI & MISO signal is equal to the above.
If not equal, use the lower SCLK speed.

Hi again,
it took me some time , but now I know what went wrong.
I did not reset the W5100 correctly. Strange, it works via software SPI then but
gets the hiccups when I use Hardware SPI.
Thank you for your help!

Hi,
I’m glad that you have solved the problem.

But, When you have still problem on H/W SPI, Compare H/W to S/W SPI’s SCLK speed & Transaction period.

Thanks.