W7500P UART1 does not receive
MCU & Boards
No replies yet. Be the first to reply.
Join the discussion.
MCU & Boards
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: W7500P UART1 does not receive
by Edward ·
Hi,
What is using firmware code??
W7500 code is together working to GPIO and PAD(alternative) setting.
So i think, not working initial to UART1.
Thank you
RE: W7500P UART1 does not receive
by irob2345 ·
Edward, are you saying that you think that the problem is in the initialisation code for UART1?
If so, why does it work correctly when modified to work with UART0 and UART2, and why does transmit work on UART1?
We have confirmed that the pin works when initialised as GPIO.
I’m happy to send you the initialisation code. What is the procedure for this?
RE: W7500P UART1 does not receive
by irob2345 ·
My code is encapsulated in C++ classes, I’ve cut & pasted the relevant init code here:
UART *UART::_handlerMap = { 0 }; // Init the static member.
uartInit(){
// Set up a dummy “/dev/null” serial port.
UART::UART()
: _def(0)
, _uart(0)
, _portnum(-1)
, _interruptNum(0)
, _sendData(0)
, _sendDataSize(0)
, _recvDataSize(0)
, _recvDataLastTick(0)
{
}
// Set up a port based on the given parameters.
UART::UART(const UART_DEF &init, unsigned portnum)
: _def(&init)
, _portnum(portnum)
, _sendData(0)
, _sendDataSize(0)
, _recvDataSize(0)
, _recvDataLastTick(0)
{
// Set up a pointer to our interrupt handler.
_handlerMap[_def->nIrq - UART0_IRQn] = this;
}
RE: W7500P UART1 does not receive
by irob2345 ·
Sorry, please ignore that last post. The code is spread across a bunch of files, I have to cut out the relevant bits and collate it together. Here it is:
void uartInit(unsigned baud)
{
// Set UART clock to internal 8MHz oscillator.
CRG->UARTCLK_SSR = CRG_UARTCLK_SSR_RCLK;
}
RE: W7500P UART1 does not receive
by Edward ·
Hi.
First, refer to below link
wizwiki.net/wiki/doku.php?id=pro … herals:afc
It is W7500 alternative function table.
for example, if you chooce UART1 to PA_07 ~ PA10 pin, It is 3rd alternative function.
So, You must setting PAD_AF3. not setting PAD_AF2.
ex) GPIO_Configuration(GPIOA, GPIO_Pin_10, GPIO_Mode_AF, PAD_AF3);
I again say, W7500 code is together working to GPIO and PAD(alternative) setting.
Thank you
RE: W7500P UART1 does not receive
by irob2345 ·
Well I tried changing the AF to PAD_AF3 and as expected, we now have no transmit or receive. AF2 is the correct setting. AF3 is for PWM function.
Perhaps you are confusing the function number with the pad selection value. This is how it works:
While the AF3 pad thing is not the right solution, thinking about pads and pin routing has given me an idea.
All the pads default to AF0 on boot, so that means that U_RXD1 will be mapped to PC03 (pin 56) by default. I’m mapping it to PA10 (pin 38) by setting PAD2 but it will still be mapped to PC03 as well, which will create a contention.
So I added these lines to un-map it from its default pads:
And now I am receiving!
It’s not displaying the received bytes - but I think that’s a bug in my buffering code. Using the debugger, I can see the receive interrupt occur and the data byte arrive.
RE: RE: W7500P UART1 does not receive
by AlexeiBazlaev ·
Thank you very much for this solution to the problem!
RE: W7500P UART1 does not receive
by Edward ·
Hi.
I checking this problem.
And later I will answer.
Thank you.