Hi
Currently, bit-banging is not used in simavr yet. In particular, UART module can't do bit-banging right now.
There is however my implementation for SPI which uses avr_bitbang.c module you mentioned.
It is still under development, but it works. You can use it for reference, if you want to implement UART bit-banging yourself.
See
PR #249 and/or full source in my branch
here.
Alternativelly, you can use simavr VCD trace facility (logic analyzer), which actually is pretty cool!
To trace activity on some MCU register, add something like that into your firmware source:
AVR_MCU_STRING(AVR_MMCU_TAG_VCD_FILENAME, "your-trace-name.vcd");
const struct avr_mmcu_vcd_trace_t _mytrace[] _MMCU_ = {
{ AVR_MCU_VCD_SYMBOL("UDR0"), .what = (void*)&UDR0, },
{ AVR_MCU_VCD_SYMBOL("RXC0"), .mask = (1 << RXC0), .what = (void*)&UCSR0A, },};
Resulting trace file can be viewed using gtkwave application.
Hints:
- To build firmware successfully put avr_mmcu_vcd_trace_t struct definition into separate source file with ".c" extension.
- Add the following linker option: -Wl,--undefined=_mmcu,--section-start=.mmcu=0x910000
- Also, you can trace any global variables from your source code with this method. For that you have to recompile simavr with MAX_IOs set to size of the MCU SRAM instead of the default value (sim_avr.h, line 69)