Page 1 of 2
Dallas 1-wire interface: sending commands ?
Posted: Thu Jan 15, 2004 1:48 am
by VJ
Hello,
I'm planning to make a circuit using an MX2 (or an MX4, still doubting) and digital pots. Those will be connected via the Dallas 1-wire interface; Paradagim has already been a huge help:
http://www.lcdforums.com/forums/viewtopic.php?t=1667
Now, the question remains: can LCDC be used to send commands to the 1-wire interface ?
If not, I was thinking of a small application to send commands / receive data and launch it from LCDC (this will be my first step, once I build the circuit). But writing a plugin would provide better compatibility, do you know if anyone is working on a 1-wire interface plugin ?
Thanks!
J
Posted: Fri Jan 16, 2004 2:56 am
by Mat-Moo
How frequently would you want to send commands? becasue this could be done using the "dsp->Process commands" and sending raw data to the port. Receiving is another matter as it all comes back in packets and has to be decoded.
Posted: Fri Jan 16, 2004 3:50 am
by VJ
First of, I have to learn more on the 1-wire interface; and I just started experimenting with LCDC (hadn't seen the DSP->process commands yet). I also will order the display shortly (either MX2 or MX4 - hence the wait) and start on the circuit (I just wanted to be sure that what I'm trying is feasable).
Sending would only be required when a digital pot needs to be adjusted (apart from the regular commands: "reset bus", "select", ...). I don't think this happens *that* frequently (is not that some data has to be refreshed every so often).
Receiving would be interesting to verify if the pot has performed the command (set speed, write the bits in register, ...) and to verify the register (startup value); but this is not fundamental... (I think)
I assume documumentation on writing a plugin for LCDC is obtained via the lcdc forum ?
J
Posted: Fri Jan 16, 2004 4:37 am
by Mat-Moo
Yes there is plugin stuff, but nothing to do things this advanced as this would require core changes.
Posted: Fri Jan 16, 2004 5:33 am
by VJ
Ok, thanks!
So basically, for sending commands, I don't need to write software at all... I just have to enter the proper string in the "DSP->process commands" and that is it.
For test purposes, what kind of software can I use to send and receive 1-wire commands ? Does the all-purpose lcd software (
http://www.matrixorbital.com/pages/downloads.asp ) suffice (haven't tried it yet, don't know if it can function without an LCD for now) ?
Or can I for instance use a simple terminal program to connect to the virtual comport ?
Is writing a small stand-alone program to send/receive raw data to/from the 1-wire interface the best approach ?
J
Posted: Fri Jan 16, 2004 6:02 am
by Mat-Moo
The LCDC test area will allow you to send commands and see responses. Also hyperterminal etc... Not sure what the other MO software does

Posted: Fri Jan 16, 2004 6:28 am
by VJ
Great! Thanks!
I'll start searching for the components for the circuit!
(tell the hardwareboys to expedite on the MX4

, it is between the MX2
and MX4 for me ;-))
Jorg
Posted: Mon Jan 19, 2004 2:28 am
by VJ
I have some more questions...
In LCDC, dsp->process commands, offers a text box. You can click to
the right of it (that diamond) to select commands (e.g. backlight on);
this name is than shown in the textbox.
Can you also enter a raw command (as defined in the manual of a display)
that is not in the presented list (e.g. the 1-wire command)? If so, how
is it entered (hex codes, characters)?
In the MO test software, I can't seem to find a way to send 1-wire
commands. I have verified the command list for various displays. (it could
be because I have no display yet)
Finally, if LCDC is running (with a display configured), can other
programs still access the same comport ?
Thanks!
J
Posted: Mon Jan 19, 2004 2:41 am
by Mat-Moo
Yes you can enter raw data e.g. [##254,1,2,3] - No no other app can access com port once assigned to any program (this is the same with all programs)
Posted: Mon Jan 19, 2004 3:29 am
by VJ
mat-d-rat wrote:Yes you can enter raw data e.g. [##254,1,2,3]
How is the command interpreted (binary stuff), for instance, how would you
enter the set cursor position to 13,2?
The syntax is: (254 71 [column] [row])
However, the manual (e.g. LK204-25) states that "Columns have values from
1 to 20 (0x01 to 0x14) and rows have values of 1 and 2 (0x01 and 0x02)";
so should the column and row be entered?
Should you put: [##254,71,0x0D,0x02] in that box?
No no other app can access com port once assigned to any program
(this is the same with all programs)
Yes, of course (duh, silly of me :-))...
(I'm trying to figure out a way to read out 1-wire data, LCDC can
apparently read temperatures from 1-wire temperature probes, so perhaps
that could be modified: different command and different return value)
J
Posted: Mon Jan 19, 2004 3:41 am
by Mat-Moo
VJ wrote:How is the command interpreted (binary stuff), for instance, how would you
enter the set cursor position to 13,2?
The syntax is: (254 71 [column] [row])
[##254,71,13,2] or [##$fe,$47,$d,$2] - $ is used before a number to represent number is a hex number.
Yes, of course (duh, silly of me :-))...
(I'm trying to figure out a way to read out 1-wire data, LCDC can
apparently read temperatures from 1-wire temperature probes, so perhaps
that could be modified: different command and different return value)
J
Posted: Mon Jan 19, 2004 4:12 am
by VJ
mat-d-rat wrote:
[##254,71,13,2] or [##$fe,$47,$d,$2] - $ is used before a number to
represent number is a hex number.
Thanks!
It is possible for LCDC to recongine/be taught new 1 wire devices,
but obviously I need one and what can be done with the data is
limited.
Yes.
Of course, once the data is in a variable, decoding should be possible
with a plugin. But sending is far more important (for my purpose), and I
can imagine there isn't much demand.
Euhm, can you store values (numbers or strings) in LCDC?
All the variables stem from plugins (readouts, data entered in plugins),
but I haven't found variables in which you could place your own data
(constants); there is a CAL plugin (on plasticrandom) that could be used
for defining numerical values, but I can't get it to work properly (should
try further).
J
Posted: Mon Jan 19, 2004 7:27 am
by Mat-Moo
I don't see any reason to do that?
Posted: Mon Jan 19, 2004 7:57 am
by VJ
Well, the digital potentiometers I intend to use have 255 different wiper settings; among others, they have commands to increment, decrement, read the current setting and write the new (absolute) setting.
With all I have learned so far, I can (or "should be able to"

) make actions to increment, decrement and write the new (absolute) setting; using the "dsp -> process command". However, I'm thinking it might be interesting to have the current setting in a variable (it is not required though (an increment at max setting does nothing), and it could be that this is merely the control freak inside me speaking

)
I also have a feeling it would allow me to make with less actions (e.g. one action for writing a speed to a pot, with the address and the speed both in variables); similarly, I'd only need one action for increment/decrement (again with the address in a variable), and it would allow faster adjustments (increment in steps of 1, for quite a number of steps could be uncomfortable - then again, most of the time it would have to work automatically based on temperatures)
Anyway, I'll see how it goes, if it bothers me, I can always adventure making a plugin (has been a while since I worked in Delphi

)
J
Posted: Wed Jan 21, 2004 7:48 am
by VJ
I just thought of something...
LCDC can scan for 1-wire temperature probes. Any idea on how it will respond when other 1-wire devices are present ?
Will it simply list them, not list them (e.g. based on type of device), or something else ?
J