USART and Zigbit problem

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi !

I have a strange problem with USART on Zigbit ATZB-A24-UFLR module.

I connect to module via FTDI USB cable TTL-232R-3V3-WE.
Cable has +5V Vcc which is used to power module throughout DC-DC on +3.3V.
RX and TX on cable work on 3.3V same as on module and they are connected directly.

In last few days I've "burned" few of them and I think that something with USART is wrong.
I can porgramm modules but they don't work(toggle pins..).

I also succeded to burn one module that I connected to with XPORT(Ethernet to USART).

I looked TX pin on module with oscyloscope and it's allways in HIGH(it should toggle when I send something out form module, right?).

I noticed that problems with one module(communication with XPORT) started when I reset it few times, but I don't know what would that make a difference?

Module needs cca. 2 seconds to initianalize USART. Could this be a problem?

Also one module doesn't work after it was not powered but RT and TX were connected to FTDI cable.

On my PCB I also use USART in SPI mode and I2C.

I didn't have these problems before and everything worked fine till now.
I don't know if I gave you correct description of my problem, because I don't know what's happening.

Has anyone had a similar problem?

static int usartOpen()
{
	usartDescriptor.tty            = USART_CHANNEL_1;
	usartDescriptor.mode           = USART_MODE_ASYNC;
	usartDescriptor.flowControl    = USART_FLOW_CONTROL_NONE;
	usartDescriptor.baudrate       = USART_BAUDRATE_38400;
	usartDescriptor.dataLength     = USART_DATA8;
	usartDescriptor.parity         = USART_PARITY_NONE;
	usartDescriptor.stopbits       = USART_STOPBIT_1;
	usartDescriptor.rxBuffer       = rxBuffer;
	usartDescriptor.rxBufferLength = LENGTH;
	usartDescriptor.txBuffer       = NULL;
	usartDescriptor.txBufferLength = 0;
	usartDescriptor.rxCallback     = usartMessageReceived;
	usartDescriptor.txCallback     = usartMessageSent;

	//BSP_EnableRs232();
	return HAL_OpenUsart(&usartDescriptor);
}



I use HAL_WriteUsart(...) to send messages.

Thanks !

Last Edited: Fri. Oct 16, 2015 - 02:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you taking into account that pin marked TX on ZigBit is "data to transmit", so RX of the MCU (modem configuration)?

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

alexru wrote:
Are you taking into account that pin marked TX on ZigBit is "data to transmit", so RX of the MCU (modem configuration)?

Yes, I think so.

Cable datasheet p.16 :
http://www.ftdichip.com/Support/...

I checked cable and TXD(Orange) is toggling when I send data form PC.

So my connection is:

Orange(cable TXD) -> pin 13 of module UART_TXD
Yellow(cable RXD) -> pin 14 of module UART_RXD

I know that I gave bad description of my problem. I don't know what's happening.

I also have doubts with JTAGICE mkII.
https://www.avrfreaks.net/index.p...

Any further ideas Alexru ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your connections are correct.

Show how do you use HAL_WriteUsart() function.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

alexru wrote:

Show how do you use HAL_WriteUsart() function.

I send messages like this:

#define LENGTH 65
static char 	usart_message[LENGTH];		 


snprintf(usart_message, LENGTH, "test");
HAL_WriteUsart(&usartDescriptor,(uint8_t *)usart_message,LENGTH);
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This code looks good. I think I'll have to see complete source code.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.