#avr Logs

Jul 01 2022

#avr Calendar

03:07 AM specing_ is now known as specing
11:20 AM MrMobius: is there a way i can simulate an AVR binary on my PC with UART support?
11:44 AM josuah: I remember there was some AVR emulator...
11:45 AM josuah: a quick look gives me http://www.avr-asm-tutorial.net/avr_sim/index_en.html (Windows) and http://avr.sourceforge.net/ (X11/Linux)
11:46 AM josuah: ah, this one too: https://github.com/buserror/simavr
11:48 AM josuah: simavr should be neat: built-in logic analyser and support for some peripherals, plenty of AT{tiny,mega} chips supported
11:48 AM LeoNerd: I've never really seen a point in them, because they don't additionally contain all the surrounding circuit attached
11:50 AM josuah: LeoNerd: such as the peripherals? these can be teidious to get right indeed, at least for me beginner
11:51 AM LeoNerd: Not the peripherals, the actual other components on the breadboard
11:51 AM LeoNerd: E.g. where's my SSD1306 OLED display panel?
11:51 AM LeoNerd: The buttons, the rotary encoder, the little 418MHz radio chip I'm talking over, ... the WS2812 LED chain, ...
11:51 AM LeoNerd: It's usually *these things* I have the most trouble with
12:01 PM josuah: ah right!
12:01 PM MrMobius: ya not that useful for the other stuff hooked up but very useful if you have code that can run in a vacuum
12:01 PM LeoNerd: That would be rather an unusual situation for a microcontroller ;)
12:03 PM josuah: maybe it works with placeholder functions that print "setting pwm value to $x" or "reading i2c sensor value" instead of interacting with the outside
12:03 PM josuah: for debugging the state machine controlling all of that?
12:03 PM LeoNerd: Sure. But that's not my problem
12:03 PM LeoNerd: E.g. the program sends the numbers that /I/ think it should send.. but the chip doesn't behave
12:03 PM LeoNerd: Turns out I had to send different numbers
12:04 PM LeoNerd: Without the real chip connected I can't check that the chip would do what I intended it to do, when I send those particular numbers
12:05 PM josuah: yes, looks like in the end, figuring out the hardware is most of the job
12:05 PM josuah: maybe MrMobius ran into more complex software rather than facing difficult hardware
12:05 PM josuah: no idea here
12:06 PM MrMobius: LeoNerd, right, the simulator wouldnt work for debugging I2C. I agree you dont need a simulator in most cases
12:13 PM josuah: after all, I have even seen software radios on ATmega328P! https://github.com/threeme3/usdx
12:13 PM josuah: https://raw.githubusercontent.com/threeme3/usdx/master/block.png
12:13 PM josuah: quite a lot happen inside for this
12:16 PM josuah: maybe that is stretching a bit what an 8-bitter can do though
12:18 PM josuah: MrMobius: what was your use-case? some number crunching? complex control? porting something over to AVR (like a small RTOS)?
12:29 PM josuah: LeoNerd: I have been trying to control ARM and RISC-V MCUs like AVR are frequently controlled: writing to registers instead of using yet another vendor SDK every time
12:29 PM josuah: LeoNerd: it works, but it really does not feel as easy as with AVR
12:29 PM josuah: LeoNerd: for which you can really focus on the content: the things connected to the AVR as you said
12:38 PM LeoNerd: Yah.. AVRs are nice like that
01:38 PM nuxil_ is now known as nuxil
03:07 PM specing_ is now known as specing
03:08 PM Thymo_ is now known as Thymo
06:25 PM MrMobius: josuah, thanks for the links. I got simavr working
06:25 PM MrMobius: does anyone know how to do UART input on simavr? it writes UART output to the terminal but doesnt accept input from the keyboard
06:31 PM josuah: not sure, I never used it
06:31 PM josuah: maybe there is a separate interface for writing through the uart from the host, maybe even a flag