hwlib icon indicating copy to clipboard operation
hwlib copied to clipboard

UART baudrate bug

Open itzandroidtab opened this issue 6 years ago • 4 comments

The uart ouput seems to have a strange bug where if you start using the uart to quick it goes on a different baud rate

Compiled program

#include "hwlib.hpp"

int main( void ){
    // kill the watchdog (ATSAM3X8E specific)
    WDT->WDT_MR = WDT_MR_WDDIS;    
    
    hwlib::wait_ms(1); // This looks like it fixes the behaviour of the uart output
    
    for(int i = 0; i < 100; i++){
        hwlib::target::uart_putc('A');
    }
}

Without the wait and CONSOLE_BAUDRATE set to 115200 baud Not working uart

With the wait and CONSOLE_BAUDRATE set to 115200 baud Working uart

itzandroidtab avatar May 24 '18 13:05 itzandroidtab

Komt dit niet doordat het even duurt voordat op de PC de console opstart? In alle voorbeelden wacht ik eerst 500 ms.

Wouter van Ooijen

0638150444 - DL200 2.86


From: itzandroidtab [email protected] Sent: Thursday, May 24, 2018 3:24:35 PM To: wovo/hwlib Cc: Subscribed Subject: [wovo/hwlib] UART baudrate bug (#10)

The uart ouput seems to have a strange bug where if you start using the uart to quick it goes on a different baud rate

Compiled program

#include "hwlib.hpp"

int main( void ){ // kill the watchdog (ATSAM3X8E specific) WDT->WDT_MR = WDT_MR_WDDIS;

hwlib::wait_ms(1); // This looks like it fixes the behaviour of the uart output

for(int i = 0; i < 100; i++){
    hwlib::target::uart_putc('A');
}

}

Without the wait and CONSOLE_BAUDRATE set to 115200 baud [Not working uart]https://user-images.githubusercontent.com/9889898/40487534-c3a31148-5f64-11e8-992c-d4412822cc4b.png

With the wait and CONSOLE_BAUDRATE set to 115200 baud [Working uart]https://user-images.githubusercontent.com/9889898/40487531-c0ac11d8-5f64-11e8-91e3-73535eef4546.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/wovo/hwlib/issues/10, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AInubDcb2gIURmSR3hJ5zqPSrGYR3g_nks5t1rSTgaJpZM4UMPUo.

wovo avatar May 24 '18 14:05 wovo

De console duurt inderdaad even voordat hij opgestart is maar dit is zonder de computer/console. Als je de pinnnen direct op een logic analyser aansluit en je niet wacht krijg je dit resultaat.

Ik kon namelijk geen voorbeelden vinden in de hwlib, v1oopc-practica, v1oopc-examples, bmptk repo's die de uart gebruiken. En bij de documentatie van de uart_putc kon ik geen informatie vinden dat er gewacht moest worden om de uart werkend te krijgen

itzandroidtab avatar May 24 '18 15:05 itzandroidtab

Was dit het probleem met die robotarm, dus nu opgelost?

Wouter van Ooijen

0638150444 - DL200 2.86


From: itzandroidtab [email protected] Sent: Thursday, May 24, 2018 5:22:45 PM To: wovo/hwlib Cc: Wouter van Ooijen; Comment Subject: Re: [wovo/hwlib] UART baudrate bug (#10)

De console duurt inderdaad even voordat hij opgestart is maar dit is zonder de computer/console. Als je de pinnnen direct op een logic analyser aansluit en je niet wacht krijg je dit resultaat.

Ik kon namelijk geen voorbeelden vinden in de hwlib, v1oopc-practica, v1oopc-examples, bmptk repo's die de uart gebruiken.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/wovo/hwlib/issues/10#issuecomment-391754927, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AInubELLxrJQ22Y-mgj_tik3sRSb7lJkks5t1tBFgaJpZM4UMPUo.

wovo avatar May 25 '18 10:05 wovo

Ik denk dat je in de war bent met een andere student ik ben namelijk niet bezig met een robot arm

itzandroidtab avatar May 28 '18 08:05 itzandroidtab