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 - IO Affectation

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

IO Affectation (by gilles galopier)
Hello !

I need some help, to make modification.

I want to use ldmicro on a spécifique IC (with ATMEGA128), on witch the IO direction is fixed by hardware. The purpose of the modification is to limit the list of IO respondig to the hardware (for exemple PIN_E3 is only a input ...).

I have tried to make some modification in iolist.c but I don't know enougth the source code to succes.

best regard.

Gilles
Thu Apr 29 2010, 03:18:11
(no subject) (by Jonathan Westhues)
According to the datasheet, the port E pins (including PE3) are all available for use as both inputs and outputs. So I assume that your needs are specific to some board that you have, where those pins happen to be wired as inputs only.

You could indeed modify iolist.cpp around line 657, to make some pins input- or output-only. Or you could write an interpreter for that part, and use the bytecode target, completely bypassing LDmicro's standard I/O assignment. But it hardly seems worth the bother, unless you really don't trust the user to assign the pins correctly.
Mon May 3 2010, 04:38:02
(no subject) (by gilles galopier)
First at all , thanks for you answer.

If I have understood :
line 661 "Prog.io.assignment[j].pin" is for io pin assigned in the actual ladder program
line 661 "Prog.mcu->pinInfo[i].pin" is the descriptor for the selected mcu.

Did I'm right ?

Best regards

Gilles
Tue May 4 2010, 11:16:58
(no subject) (by Jonathan Westhues)
Correct. Prog.io.assignment is the map between variable names and microcontroller pin numbers for the current program. That's essentially the information that appears in the I/O list at the bottom of the screen.

Prog.mcu->pinInfo[] is the map between microcontroller pin numbers and bits or registers for a particular chip. The compiler needs that information to generate code.
Tue May 4 2010, 11:35:56
(no subject) (by gilles galopier)
thanks.

I'll look about that point, and try to put the IO direction in a config file.

Best regards

Gilles
Wed May 5 2010, 03:24:29
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):