Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Working ATMEGA2560 version

(you are viewing a thread; or go back to list of threads)

Working ATMEGA2560 version (by Oguz)

I have attached my latest version that generates working ATMEGA2560 code. The main problem was that ATMEGA2560 RAM started from 0x200, not 0x100.

Also, I padded IO address arrays in mcutable.h with zeroes to explicitly null terminate them to be on the safe side.

I tested everything on this board:

http://www.bipom.com/boards/us/851677.html

I created a MINIMAXAVR-C folder under Samples for this board. It contains the traffic lights example modified for this board.

Thanks

Oz
Sun Sep 20 2009, 21:57:48, download attachment ldmicro_src.zip
(no subject) (by Jonathan Westhues)
Excellent. Though it's not necessary to include those zero bytes. Uninitialized static variables are guaranteed to be filled with zeroes by any compliant C compiler.

Have you tested all the peripherals (ADC, PWM, UART, EEPROM)?
Sun Sep 20 2009, 22:08:22
ATMEGA2560 Peripherals (by Oguz)

UART works. It would be nice to be able to specify the UART in the ladder program, or at least in Settings>MCU Params. ATMEGA2560 has 4 UART's !

Formatted UART works, too.

ADC always returns 1023 for some reason. PWM controls the correct pin but does not change the duty cycle. So these need more work.

I have not tested the EEPROM yet.

About zero padding: This is more for clarifying the code. When I changed MAX_IO_PORTS to 11 for ATMEGA2560, I noticed during single-stepping that the array operations relied on null terminations and was inadvertently going past the end of the array; the fact that it relied on null termination was easy to overlook.

Oz
Fri Sep 25 2009, 01:01:15
(no subject) (by Jonathan Westhues)
Fair point with the termination. Then it would have produced a "too may initializers" warning, which would have made the problem obvious.

Please do look at the peripherals stuff. Once everything looks okay, you can post the source (or just the changed files, or just a diff), and a .exe so that other people can test. If all seems good then I'll add the target to the next release.
Fri Sep 25 2009, 01:10:18
LDmicro on 2560 (by Matt)
All,
I need help getting this LDmicro version to work on my Mega2560. Does anyone have step-by-step instructions for a non-programmer such as myself?

I've built prog in LD, compiled to hex, uploaded hex to 2560 using Xloader, and it says that it was successful. However, the arduino program doesn't work. It seems that the correct input pin is activated (with +5vdc), but the output never "goes". I've tried even dummy dummy programs with a simple output set to true, but no dice.

Thanks.
Thu May 8 2014, 08:28:29
Request for Adding Atmega328 (by Amarduino Mikro)
hello Jonathan,
hello Oguz.

thank you so much for this LDmicro.
I am very happy to use it.
I want to ask, is there a possibility to add one more
choice of microcontrollers that can be used, such as atmega328? So that I can also use it with the Arduino,
so no need to make hardware anymore.
Once again, thanks a lot.
Wed Jun 17 2015, 09:32:53
ATmega2560 (by Raśl)
Very good! I have seen that there are people who are used ldmicro on this processor but I found the version or not doing, where you could find?
Fri Oct 14 2016, 02:29:21
(no subject) (by Ihor Nehrutsa)
Latest releases you can find at
https://github.com/LDmicro/LDmicro/releases

v4.0.4 is stable for AVR.

Attention! Just now I find bug in LDmicro with J, K, L ports addreses in ATMega2560. Dont use this port temporarily.
I fix this in next release of LDmicro v4.0.5.
Fri Oct 14 2016, 09:46:38
(no subject) (by Alex)
Hello Amarduino i'm checking your youtube channel about ldmicro.
Fri Oct 14 2016, 14:23:28
(no subject) (by Alex)
Good applications
Fri Oct 14 2016, 14:25:01
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):