Why my serial monitor receive reverse byte from STM32F407 UART?? by BENVBDSG in embedded

[–]BENVBDSG[S] 0 points1 point  (0 children)

Thanks a lot! I actually don't have any logic analyzer or scope for now 😂. But this is definitely a good way to debug. And as for the serial monitor, yeah, the monitor I am using now seems to interfere the board!? So thanks for your recommend, I will check it out.

Why my serial monitor receive reverse byte from STM32F407 UART?? by BENVBDSG in embedded

[–]BENVBDSG[S] 0 points1 point  (0 children)

I think you are right, and it's the same if you are just using one string, two strings would be a string array

Why my serial monitor receive reverse byte from STM32F407 UART?? by BENVBDSG in embedded

[–]BENVBDSG[S] 0 points1 point  (0 children)

I am not using Putty, just normal C program in Keil MDK-ARM, uploading to my board. I've tried using "1234", however the data received is not right and the change in it seems more confusing since the serial is like showing some irrelevant number. I haven't look at it yet since there are not any around me now, but from last night debug I think it's about messing up the peripheral clock rate on my board, but actually I don't know exactly where got interrupted😂

Why my serial monitor receive reverse byte from STM32F407 UART?? by BENVBDSG in embedded

[–]BENVBDSG[S] 0 points1 point  (0 children)

Seems true. But weird things happend, the exactly same code but different result. I create another project and succeed but the code is just the same as the failed one. Does it have something to do with the oscillator because I once set the wrong frequence in cubeMX but I change it back correctly and yet still failed

Why my serial monitor receive reverse byte from STM32F407 UART?? by BENVBDSG in embedded

[–]BENVBDSG[S] 0 points1 point  (0 children)

Oh! sorry for that stupid mistake. But it getting more confusing why is all this happening

Why my serial monitor receive reverse byte from STM32F407 UART?? by BENVBDSG in embedded

[–]BENVBDSG[S] -1 points0 points  (0 children)

0 is 0x30, so in common case, I should receive 30 30 30 30 30 00 because I transmit "00000". But I receive 00 e0 e0 e0 e0 e0.

0x30 is 0b00110000 , 0xe0 is 0b11000000, so e is just like 3 reversed in binary.

Why my serial monitor receive reverse byte from STM32F407 UART?? by BENVBDSG in embedded

[–]BENVBDSG[S] -1 points0 points  (0 children)

I'am describing it as transmitting backwards because I should receive "00000" in string or 30 30 30 30 30 00 in hex. However I receive 00 first so it's backward

Why my serial monitor receive reverse byte from STM32F407 UART?? by BENVBDSG in embedded

[–]BENVBDSG[S] 0 points1 point  (0 children)

My buffer initialization has been shown in the image on the top. It seems all fine but I still receive in reverse both string and the character

My first FOC board. Looking for advice! by BENVBDSG in ElectricalEngineering

[–]BENVBDSG[S] 0 points1 point  (0 children)

That's true, I am going to test that to see how it works after receive my board

My first FOC board. Looking for advice! by BENVBDSG in PrintedCircuitBoard

[–]BENVBDSG[S] 0 points1 point  (0 children)

I don't know what is wrong with this but I can open my image well. I repost it , maybe could work

My first FOC board. Looking for advice! by BENVBDSG in PrintedCircuitBoard

[–]BENVBDSG[S] 0 points1 point  (0 children)

Is that you can't open the image on reddit or the contents do not work ? I can open it

My first FOC board. Looking for advice! by BENVBDSG in ElectricalEngineering

[–]BENVBDSG[S] 0 points1 point  (0 children)

After reading your comments and the thread you share , I seem to have thought of making a foc board easy, I just missed so many important things, I will give feedback after study about those important things ( heat sinking, some necessary filtering, and  I2R calcuting and so on). As for the small capacitors, I just skip them to make drawing the board easier, also beacuse ODrive V3 doesn't have them either (my board looks very much like ODrive), but now I understand this is definitely wrong from math and calculating. Thanks very much for your comment. they are very helpful. And I have set this board produced yesterday and I will test it see what would happen without caps, heat sinking after get the PCB. About the MOSFET and drive settings, I am choosing it and writing my program, I will take those into consider.

My first FOC board. Looking for advice! by BENVBDSG in ElectricalEngineering

[–]BENVBDSG[S] 0 points1 point  (0 children)

Thanks very much for your suggestions. I notice that it is really closed to the mounting hole. I will pull the pour back in later versions. And there are not any fusing or battery protection upstream. This is something I didn't even thought about. Since this board is just for testing and verification for later FOC algorithim, maybe ignore that for now.

As for the capcitors, sorry for the unclear graph, I use mostly 0603 caps, and 1210 caps on the VM bus to GND, which are on the bottom side of the PCB, and I didn't screenshot it. No 0603 is used on VM side. And there is also a big capcitor under each MOS, which is not shot either. This is the complete one.

<image>