Search code examples
simulatoruartatmelatmegaatmelstudio

atmel simulating UART comm


I am working on a project with the UART controls. I am attempting to simulate the sending and receiving of messages through the UART. The UART will be connected to a RS-485 transceiver in the real world but I will be providing the input/output through a test.c file.

Currently, I have to pause the execution of the program in the simulator, manually flip the bit and return the program back to execution again for the UART to send about byte.

My question to the group is can I auto-magically set the TXC bit to simulate a successful transfer of bytes? I am currently reading through Atmel's documentation and deciphering how to setup a stimuli file.

This would help out since I would like to make the communications testing more complicated the deeper I get with development.

Thanks, Ryan


Solution

  • For me it is quite hard to understand your english...

    set the TXC bit to simulate a successful transfer

    On the real hardware you can't set TXC manually.

    If you are talking about simulation environment, I only use http://www.nongnu.org/simulavr to do this kind of jobs. In this simulator you simply can add a c/c++-testprogram which runs on the host in the native host fashion and connect a simulated uart to the simulator which runs your avr program.