DSPS PAN1740 and UART Problems

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
9 posts / 0 new
Last post
gert186
Offline
Last seen:1 year 3 months ago
加入:2016-04-21 12:59
DSPS PAN1740 and UART Problems

Hi,
I would like to program a connection UART over Bluetooth as fast as possible. It Works real good but now my problems.
According to the manual of connect two PAN1740 I disabled the HW Flow control and enabled the SW flow control. They connect to each other.
PAN1740直接连接到ATMEL控制器llers who makes the work.
The Problem is: I programed an Receive Interrupt on one Atmel and the Bluetooth module (PAN1740) always sends nonsense Data to the Atmel and the Interrupt happens every time.
The Data of nonsense is about in Hex 11 or 13 or both.
I don't know where it comes from.
It only happens when the two PAN1740 are connected.
Any Ideas about that?

A nother Question is to put the PAN1740 into Sleep mode with External connection to the Atmel. PIN 1.0 of PAN1740 is directly connected to the Atmel I/O. How can I program that if the PAN got an High at Pin 1.0 from the atmel that it will go sleep and a Low it will wake up?

Hope you can help me.
Thanks a lot

Device:
gert186
Offline
Last seen:1 year 3 months ago
加入:2016-04-21 12:59
Hi, I solved the Problem. It

Hi, I solved the Problem. It was the software Flow Control which produces the interrupt on my microcontroller.
The next Problem is, if I would like to send data over DSPS without Flow Control The data is sending each 10ms
38400 baud

THe Data Should be T1 with additional random value i get on the other side:

T163
ü¦k©ˆø¬™[R¤ü¨˜[RHøT163
T163
T163
T163
6(ÿ¨[R¤ü¨™[R¤ü¨›3
T163
T163
T163
Ym¨™[V¤ü¨˜[R¤ø¨165
T165
T165
T163
#ñ¬™[I#ñ¬™[V¤ü¨[¦C…T163
T163
T165
T167
Æ5)ÿ¨™+©ˆø¨˜©ˆø¨˜70
T167
T165
T163
Rþ)EI5) y¨(«¤u¨(SHøT167
T165
T167
T167
Ý5ÿ¨[«¤ü¨™[¥!ᨘ65
T163
T163

What is the problem? If I sniff the TXD line of my microcontroller everything make what he should. but not on the other side....

Any Tips?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi gert186,

Hi gert186,

I assume that you are using the DSPS reference design, and you are sending data through the Atmel processor towards the UART of the 580, since you have disabled the hw flow control and you have enabled the SW flow control the 0x11 and 0x13 are the XON and XOFF bytes (the actual bytes that control the flow control) that are send only when the two devices are connected.

Also be aware that the DSPS needs h/w flow control in order to operate properly and be in sleep mode, there is no way to use DSPS with sleep and with no flow control since the external MCU will send data but it wont know if the 580 is sleeping or not.

Regading your second question in your first post, the DSPS will automatically set the sleep mode of the device, if it has data to send it will stay awake and if not it will go in sleep mode and wake up only in order to keep the connection alive. If you would like to set the device in permanent sleep you will have to manually disconnect from the remote device and set the wakeup timer in order to wake up and start advertise from an external interrupt, you will be able to find info regarding how to use the wake up timer in the UM-B-051-DA1458x Software Platform Reference.pdf in paragraph 10.7.

Thanks MT_dialog

gert186
Offline
Last seen:1 year 3 months ago
加入:2016-04-21 12:59
Thanks a bunch for your post.

Thanks a bunch for your post.
But I want to switch both of SW and HW Flow Control! is that a problem ?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi gert186,

Hi gert186,

Yes, it is a problem since the DSPS, when in sleep mode, works only with hw flow control (even with sw flow control the device will lose data), this is because the 580 notifies the external MCU/PC that is awake by toggling its RTS/CTS. If the external device sends data and the 580 isn't awake, there will be data loss.

Thanks MT_dialog

gert186
Offline
Last seen:1 year 3 months ago
加入:2016-04-21 12:59
I programmed everything now

I programmed everything now with SW Controll. works like a charme.
I have a I/O connection to the bluetooth module on pin 1.0
is it possible to bring the bluetoothmodul to sleep if a Low is on the pin and wake if a High?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi gert186,

Hi gert186,

As mentioned in the previous post, the device wakes up in every connection interval in order to keep a connection alive, if you keep the device sleeping and waiting for a wakeup interrupt that means that it will lose connection, if it looses connection that means that the next time it will wake up (from an external interrupt) it will have to go through the connection procedure in order to reconnect with the central/peripheral. If this is something that you would like to do then you can use the wakeup timer module and set it up in order to start advertise upon external interrupt but i would suggest to terminate the connection before going to sleep.

Thanks MT_dialog

gert186
Offline
Last seen:1 year 3 months ago
加入:2016-04-21 12:59
Many thanks,

Many thanks,

But what I realy want to do is to put the Bluetooth Module into sleep mode (extended) if it receives like SL4000!
"SL" for go into sleep
"4000" the time in seconds
"!" Termination sign.

I can put this functionality in the
user_sps_server_data_rx_ind_handler(). to check what is received.
Then put the BLE into extended sleep mode like :

app_easy_gap_advertise_stop();
arch_ble_ext_wakeup_on();

But I don't know how to configure the wake up timer?

Can somebody helps me.

Best regards Gert

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi gert186,

Hi gert186,

To start with, you can only receive data while you are connected therefore not advertising, thus its not neseccary to invoke the app_easy_gap_advertise_stop() function, so if you would like to put the device in permanent sleep you will have to disconnect from the central device by invoking app_easy_gap_disconnect() as soon as the device is disconnected, the .app_on_disconnect callback is going to be triggered. So from that callback you can either set a kenrel timer to start advertise or set up a wake up interrupt. If you just disconnect from the device, since the device hasn't got any scheduled messages to wake up, it will stay in sleep, you only have to configure how the device is going to wake up. In order to check how to configure the device to wake up you can have a look at the ble_app_sleepmode and also you will be able to find documentation regarding the wake up timer in the UM-B-051 Software Platform Reference.pdf in paragraph 10.7.

Thanks MT_dialog