Uart behaviour on AVR & Simulator (by José GILLES)
Hi
I'm not an expert in ladder, but I tried the attached ladder to make a simple Uart echo on a true Atmega16.
As you may see on screenshots, this ladder works perfectly (as expected) in simulation with ldmicro 4.4.3.0, but when compiled directly in hex or via C compiling, it makes infinite echo of the last char sent (via hyperterminal).
It rises 2 questions:
1) Isn't it abnormal to have a different behaviour between simulator and true life ?
2) Ain't there a pb with UART in C or Hex/Asm ?
To finish, may someone explain me how to use "Uart Sedn variable" function ? Even with the source code, I don't understand what it is made for ?
Thanks for your answers
JG
(no subject) (by José GILLES)
Thanks for your answer !
Your ladder works fine in 3 modes.
Nevertheless, there remains a problem somewhere since simulation and compiling don't give the same result with mine.
Which is the right behaviour according to ladder logic ?
You seem to know perfectly ldmicro : so, could you please help me in understanding the famous "Uart Sendn variable" contact ???
Best regards
JG
(no subject) (by MGP)
I never have used the instruction Uart Sendn, but I think it does not work because the outcome should be as sending \x01 .. \xFF with the instruction "Formated string over UART"
I'm working with pic's and have no problems with the Uart instructions and I use them alot.
I only compile my programs to hex never to C or ....
Sorry but I can only help you with ladder programs.