Configuring PSOC 4 DTM/HCI example for high speed UART.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
PeTy_2173191
Level 2
Level 2

Hello,

   

The DTM/HCI example works fine for speeds up to 115200 baud.

   

However for higher speeds the systems fails due to improper clock setup.

   

How to setup the clock for e.g. 460800 baud?

   

At 24Mhz and divider 3 i get: 8Mhz which is a bit from the optimal 7.373 which will give bit errors once in a while (and it does).

   

Changing the IMO to 30Mhz gives a nicer 7,5Mhz.... but then it stops working all together. Not sure why. Should work better, but the entire system seems to stop working.

   

It is a bit unfortunate that the DTM does not work out-of-the-box with anything above 115200. At 115200 it is a bit hard to use the "data packet length extension" for anything as that would require much higher bandwidth at full speed.

   

How do i resolve this, so i can run faster on the UART in the DTM/HCI example? Is this a bug and/or missing feature?

   

/pedro

0 Likes
1 Solution
PeTy_2173191
Level 2
Level 2

Aha! I figured it out.

   

It is not broken, but a bit lacking on the documentation.

   

The 9600 -> 115200 is actually working if you configure the RTS/CTS correctly!

   

To get higher speeds to work you have to cheat! When setting the UART to e.g. 460800 you really have set set it to 500000.

   

This is probably because their favorite frequency is 24Mhz.

   

This is done in the example automatically if you try to set it to 460800 as the nearest sampling frequency is stated as 8Mh in the DTM example.

   

With the OVS needed, This gives exactly 500000, as 8000000/16 = 5000000

   

The UART/USB converter in the Pioneer kit knows this and compensates. So one side will be running 500000, and the other will be running the correct 460800 (towards the PC).

   

Only catch left is that that if you cannot keep up speed-wise on the PC, you are going to loose packets no matter what.

   

Thanks,

   

/pedro

View solution in original post

0 Likes
6 Replies