couple of minor changes make life easier
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 23 Apr 2022 13:07:22 +0000 (14:07 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 23 Apr 2022 13:07:22 +0000 (14:07 +0100)
* minicom and screen typically expect 115200 baud rate
* carriage-return line-feed otherwise minicom scrolls off edge

uart_demo.py

index 89c40e71fc544d16e4c02464b00f20fb3d95ad05..22eecaf428a911f518902ba6603520edf5b6a998 100755 (executable)
@@ -63,7 +63,7 @@ class TickGenerator(Elaboratable):
 class SimpleUART(Elaboratable):
     """Simple transmit-only UART"""
 
-    def __init__(self, baud_rate=9600):
+    def __init__(self, baud_rate=115200): # default for minicom/screen: 115200
         self.__tick_gen = TickGenerator(baud_rate)
         self.data_in = Signal(8)
         self.data_in_valid = Signal()
@@ -219,7 +219,7 @@ class TestUartDemo(unittest.TestCase):
 
 
 def build(platform, do_program):
-    platform.build(UartDemo("Hello World!\n"), do_program=do_program)
+    platform.build(UartDemo("Hello World!\r\n"), do_program=do_program)
 
 
 PLATFORMS = {
@@ -229,7 +229,7 @@ PLATFORMS = {
 
 DEFAULT_PLATFORM = next(iter(PLATFORMS.keys()))
 DEFAULT_TOOLCHAIN = "yosys_nextpnr"
-DEFAULT_TEXT = "Hello World!\n"
+DEFAULT_TEXT = "Hello World!\r\n" # carriage-return line-feed
 
 PLATFORMS_TEXT = '\n'.join(PLATFORMS.keys())
 HELP_TEXT = f"""