#avr Logs

May 03 2021

#avr Calendar

07:18 AM specing_ is now known as specing
08:08 AM vmt: i would imagine people who use pickit4 would also use mplab
08:42 AM Sponge5: Hi, has anybody here ever encountered a problem with communicating with other MCUs over USART? I'm using a library that is probably considerably faster than the Arduino implementation and now I'm forced to add at least 100us timeout after each byte in a datagram for them to register on the other end.
08:43 AM Sponge5: I believe that's not a baudrate problem.
09:26 AM exp: Sponge5: no oscilloscope or anything?
09:27 AM exp: you should dump all the relevant information for what hardware you're using, how you've set up the control registers, how it's wired etc
09:29 AM Sponge5: exp: I was just asking if anyone else ever had a similar problem. If I don't fix it myself I might ask further with sufficent verbosity
09:30 AM exp: fair enough, it's quite quiet in here so usually better to just dump out what you have
09:44 AM Sponge5: no worries, I think it wouldn't be very time efficient, there's a lot of moving parts and I don't think the problem's with AVR
09:46 AM Rab: Sponge5, many Arduinos use a ceramic resonator having an abysmally bad frequency tolerance for the clock.
09:48 AM Sponge5: Rab: that's not the problem, I'm communicating from mega2560 to tmc5072, there's no arduino HW. Just the serial communication library from Arduino is probably way too slow
09:49 AM Rab: Sponge5, sorry, someone was asking about an Arduino Pro Mini the other day and I got confused.
09:49 AM Sponge5: reason why I'm talking about arduino is that the demo from trinamic is for Arduino and when I ported it to freeRTOS on mega2560 it only started working after I added 100us delays after each byte
09:53 AM Rab: I've never had such an issue, but I'm usually operating at low baud rates. What are you using?
09:53 AM twnqx: more like "1 bit length" to transmit the stop bit
09:54 AM Sponge5: twnqx: I had a suspicion the 8N1 protocol might be an issue, but didn't look into it too much
09:55 AM twnqx: i was assuming you're bitbanging serial, not using a hardware port
09:56 AM Sponge5: Rab: baudrate shouldn't be an issue, the messages are not garbled, just missing individual bytes
09:57 AM Sponge5: twnqx: I'm sending chars using serial.c from here https://github.com/feilipu/avrfreertos
09:58 AM Sponge5: (freeRTOS v10)
10:01 AM Rab: Sponge5, how are you monitoring the problem? Does the TMC5072 echo serial commands, or are you monitoring the physical link through outside means, or something else?
10:03 AM Rab: Generally when troubleshooting serial communications I will attach either a serial-to-USB converter or a logic analyzer to TX/RX, and it tells me right away whether the problem is on the send or receive side.
10:04 AM Sponge5: Rab: yes the TMC echoes commands back and also I can read registers and I haven't found an issue yet (when the delays are there)
10:05 AM Sponge5: It's not a huge problem, just peculiar
10:14 AM Sponge5: By the way, I also have to add 100us delay between received bytes, because the TMC5072 transmitter sends them slowly too.
10:58 AM Rab: It sounds like a clock mismatch. Is the TMC5072 using an internal or external clock?
11:01 AM Rab: Are you using Trinamic's eval board?
11:12 AM Sponge5: Rab: Internal clock, prototype board
11:32 AM Rab: Is the clock input connected to GND?
11:47 AM Sponge5: Rab: It should be, can't confirm right now
11:47 AM Sponge5: Sorry, gtg and I don't have a bouncer
11:48 AM Sponge5: thanks for attention
07:17 PM specing_ is now known as specing