WIZnet Developer Forum

why #define DSP_SHIFT (1) is used in w5300.h file of example project for DSK-INET daughter card stacked on DSK6713 by midnight cow author

Hi Everyone

I am running a simple loopback project which came with the DSK-INET daughter card ( with Wiznet w5300 iEthernet Chip) from Bitec using DSK6713 platform from Texas Instruments. In this Project, author Midnight Cow, has followed version 1.1.1 of wiznet w5300 ethernet controller APIs. This project contains 3 source files (main.c, socket.c and w5300.c). In one header file , w5300.h, a constant is defined by #define DSP_SHIFT (1) statement. In the data sheet of w5300, Register Address Offsets are clearly mentioned to access these registers from DSK6713 but in the given code Address Offset of every register is left shifted by DSP_SHIFT value before use and that is also equal to multiply that Offset Address by 2. This makes Adress Offset of a particular register double the value as mentioned in w5300 data sheet.

I do not understand why Midnight Cow (Author of the Code) has done this DSP Shifting of Register Offset Addresses? Please tell me reason behind this?

Thank You All

Where did you find it? https://github.com/Wiznet/ioLibrary_Driver/blob/master/Ethernet/W5300/w5300.h

No, I am using a simple example project which sends back tcp or udp pakcets to PC in a loopback fashion which came with the DSK-INET daughter card that I bought from Bitec. In this project all of the wiznet source and header files (like w5300.c, w5300.h, socket.c and socket.h) are modified to run on DSK6713.

Why do you think that @midnightcow has ut these modifications into your header file, and not those people who were modifying it for using in your project? I can not find header file you refer to on the internet.

I think you need to go to this Bitec’s “DSK-INET” project developers for support with your questions why they have these specific modifications in this file. I do not see any source file download for this product on their web site.

Thank you @Eugeny. I am very grateful for your support. You are right neither modified source and header files are available on internet nor Bitec has any support forums to discuss this. I just thought may be there is someone out there in this community who has used DSK-INET and is able to share his experience. I should better email Bitec Support guys to help me out. If you want I can share these files with you ?

Actually you can to to profile of @midnightcow and send him private message asking his thought about it, and ask for his attention to this thread so that he can reply asap. I think you will at least know if this is his modification or not.

Yeah, may be… But I don’t see any option in his profile for sending private messages.

Dear All.

DSP chip and STMicrochip is different from the general MCU.
I don’t have remember exactly about that, but as i know these chips use the-byte-address-system in the core-inside, but they output the-internal-address(byte-address) to word or half-address-system thru ADDRRESS pin.
That is, when the internal-address is output via ADDR pin, the-internal-address shift-right first, then it is outputed.
So, DSP_SHIFT(1) macro makes a double the address value in advance to get the same result when the-internal-address is shifted right.

For more detail, Refer to MCU’s datasheets.

2 Likes

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.