Author |
|
didi Newbie
Joined: November 29 2001 Location: Belgium
Online Status: Offline Posts: 34
|
Posted: January 13 2005 at 13:54 | IP Logged
|
|
|
Dave,
What kind of K8000 conrols are you thinking of implementing ?
You say your I2C routines are really fast. That is great news. I've written a few Visual Basic programs with the K8D support dll files and i could check every digital-in only once every second.
In my present standalone setup, my Bticino pushbutton wallswitches have different functions, according to how many times per 1.5 second you push them.
Thus, the Visual Basic setup turned out useless because i could not scan my buttons fast enough.
With your very fast I2C routines, all of out switches could keep the same functions they have now and therefore, my wife would still love me ones PowerHome controls the house
Keep up the great work Dave
Dirk
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: January 13 2005 at 14:12 | IP Logged
|
|
|
Dirk,
Im havent checked the read speed yet (Im writing those routines now , but was able to switch on and off very fast.
From what Ive done so far, I would imagine scanning the digital I/O would be very fast as well. However, since the K8000 doesnt automatically send event changes, I will have to poll for them. This will be a user supplied parameter in the INI file where you'll set how often you want PowerHome to check for changes. Once I get more into it, I'll have a better idea of what it will take.
Up to how many button presses are you looking to register within that 1.5 secs?
Dave.
|
Back to Top |
|
|
didi Newbie
Joined: November 29 2001 Location: Belgium
Online Status: Offline Posts: 34
|
Posted: January 13 2005 at 14:38 | IP Logged
|
|
|
Only 3 button presses. It is currently based down like this :
I detect rises and falls of the buttons.
If a rise (from 0 to 1) occurs, a timer of 1.5 seconds for that button starts. In this period, several things can happen :
no fall, no rise (means the button is still pressed when the timers stops) In my setup, this starts incrementing an analog out to brighten the light appointed to that button
one fall, one rise (means the button got pressed and released and pressed again) - this starts decrementing an analog out to dim the appropriate light
one fall (means button got pressed and released) switches the light on if it was and off if it was on.
one fall, one rise and another fall (means the button got pressed and released twice) I use these for the on/off relay functions (Velleman relay card)
ect, ect, ......
The maximum in my setup is 3 complete button presses (3 rises and 3 falls)
I have walltype pushbuttons throughout the house, all with different lights and fuctions appointed to them in software
|
Back to Top |
|
|
didi Newbie
Joined: November 29 2001 Location: Belgium
Online Status: Offline Posts: 34
|
Posted: January 14 2005 at 04:31 | IP Logged
|
|
|
A few ideas :
Declaration of in's and out's in Powerhome Explorer..
Here, one can declare wich of the 64 possible gates are used as in's, and wich are used as out's.
Also, the user can declare how many K8000's he used so PowerHome knows how many variables it needs to reserve for the analog in's and out's.
K8000 System Poll Frequency in PowerHome Explorer
As you mentioned earlier.
Triggers
As triggers can already be declared for incoming infrared, incomming X10 ect ... it would be great if they could also be used for rises and falls of the Velleman in's and out's too.
Analogue in's and out's
These could be simple variables within Powerhome where you could read from (for the in's) and write to (for the out's).
What do you think Dave ?
|
Back to Top |
|
|
phil13 Groupie
Joined: December 19 2004 Location: France
Online Status: Offline Posts: 60
|
Posted: January 14 2005 at 09:39 | IP Logged
|
|
|
Dave
You said : "However, since the K8000 doesnt automatically send event changes".
I don't use the K8000 but i use the PCF8574 component and on it, you have an INT pin for sending interruption when an input has changed.
I don't know if you can connect this pin directly to the pc ... perhaps it is possible to add this pīn on the DB9 connector ?
If not, as the K8000 has 2 PCF8574, you can try to connect one INT to an input of the second PCF8754.
You loose an input, but by reading only one I2C adress, you can bkow if one of the 16 inputs has changed ...
I've also read something about speed. The standards speeds of I2C bus are 400 Khz and 100 Khz.
I you want, i've basis I2C procedures in Turbo Pascal.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: January 14 2005 at 10:02 | IP Logged
|
|
|
Dirk,
It's like you were reading my mind .
My current thinking:
1. A new button in the Controllers screen which takes you to a new device dependant screen for Configuration. With the K8000, you'll select which cards you have addressed (0,1,2,3), which digitals are configured as inputs and outputs, and the polling frequency.
2. New screens for the declaration of digital inputs and outputs, analog inputs, and analog outputs. I would like to meld the realtime viewing of these screens into the current X-10 Status Screen (along with a new name). You should also be able to modify the outputs from this screen just as you can with X-10. For analog inputs, you'll be able to define a formula that will be applied to the returned value.
3. Triggers for digital in's and digital outs. Still undecided upon triggers for analogs.
My current problems. I got the routines finished for reading the digitals (so I now am able to read and set the digitals). Ive also written the routine to set the 6 bit analog outs. However, it appears that once Ive set an analog out, there is no way I can query the K8000 to find the current setting (I will be storing the current setting as I set it of course, but if PowerHome were to be restarted, I have no way of determining the status of the analog outs at startup like I can with the digital outs).
Because of this, I will have to break my functions down into smaller components (this is all just internal problems from my perspective and Im just ranting ).
Anyways, Im hoping to finish up my base routines today (reading, writing analogs, etc.). I'll then start the basic configuration screen (I must know what is configured as digital input and output in order to properly send commands to them). I'll probably next move to the input/output definition screen. This is different from the configuration screen but will be redundant in the K8000 case. This screen will allow you to declare an "ID" and then define the "Location", the "Controller", whether it's an input or output (the redundant part), the point number, etc.
After that is done, I'll start the triggers. Im trying to decide which way to go on the triggers. I could have the trigger be based upon the "ID" as defined in the I/O screen described above, or I could make it more generic where a trigger is based upon a controller and point number. In the former, in order to fire a trigger, the point must be defined. In the latter, a trigger can be fired whether the point is defined or not. The former has a little more overhead because the point must now be looked up to determine the ID, the latter has no reference so you must remember what is any given point. Decisions, decisions.
I would like to solicit votes for one particular way vs another. This same decision will also be used for the digital triggers for the CPU-XA/Ocelot so if you have an opinion, post it here and let me know.
Dave.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: January 14 2005 at 10:11 | IP Logged
|
|
|
Phil,
WOW, you went over my head on that one . I know enough about hardware to make me dangerous, but not at the level you're speaking of. I havent looked up the chips used by the K8000 to see what they do, but I probably should so I can get a better understanding of how it works.
I think Ive nearly gotten my I2C routines written, but if you want to pass along some source to me, I can see what else I can learn since this is a totally new area for me.
Thanks,
Dave.
|
Back to Top |
|
|
phil13 Groupie
Joined: December 19 2004 Location: France
Online Status: Offline Posts: 60
|
Posted: January 14 2005 at 11:30 | IP Logged
|
|
|
Dave,
all my system is based on I2C ...
- 16 digital input - PCF 8574
- 8 digital output - PCF 8574
- Vocal - ISD5116
- RTC clock - PCF 8583
- "CM11 + TM13 multi code house" made self with a pic in I2C slave mode + a TW523 + Aurel radio frequence receiver. You can dialog with it in rs232 and I2C.
- EEprom - 24L64
- temperature ....
But all is managed with a pic not with a pc.
So i've not tested the pascal I2C proc :
http://perso.easynet.fr/~chrisg/busi2.htm
click on "logiciel pour pc".
I think the best way to manage I2C with a PC is to use the special component made for that : PCF8584.
This component manage all I2C timing.
I think you can find pc interface with this component.
Philippe
|
Back to Top |
|
|
didi Newbie
Joined: November 29 2001 Location: Belgium
Online Status: Offline Posts: 34
|
Posted: January 14 2005 at 11:41 | IP Logged
|
|
|
Phil,
We could connect the int's to the Data pin's on the parallel port. There are max 8 PCF8574 chips to be adressed so we would need all the Data pin's on the DB25.
Since the int's are 0 when active, we would need to run them trough an inverter because the Data ports on the DB25 are +5 when active. Dave would then have to write a routine that polls the parallel port Data bits and i think the I2C protocol gets in the way there.
If, like you say, the I2C bus can be adressed with speeds starting from 100kHz and Dave's 'Home Made I2C Routines' are fast and don't take to much overhead, i don't think there's much use for this workarround.
What do you use the PCF8574's for ?
Dave,
Followed you right up to the triggers.
You completely lost me there with the pointers and the ID's
Could you elaborate on those one a little more ?
Just ran a UTP of 25 meters (75 feet i think) from the K8000's to my PC upstairs and soldered 2 DB25's on and ... it works like a breeze. The I2C protocol surfs on UTP just fine.
Everything here is ready for testing
|
Back to Top |
|
|
phil13 Groupie
Joined: December 19 2004 Location: France
Online Status: Offline Posts: 60
|
Posted: January 14 2005 at 12:19 | IP Logged
|
|
|
didi,
in fact, you can adress 16 PCF8574 because it exist in 2 versions with differents bases adresses.
I don't know the DB25 port. It is not possible to scan a pin state ?
I use the 8574 for my alarm system like a K8000 ...
For the speed, my experience is not go up 100 khz except if the components are on the same card (I2C memory / microcontroller at 400 Khz).
If you want to connect the I2C component with distance you have to down the speed and/or add buffer with transistors.
But 25m is i think too much for I2C.
Initialy the I2C bus is not design for distance, it is design for components inside a same machine (TV, ...).
The rs485 or can bus is made for high distance.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: January 14 2005 at 12:42 | IP Logged
|
|
|
Dirk,
With the triggers, I basically have two ways to implement them. From the triggers screen, after I select a trigger type of "Digital Out" or "Digital In", I could then next select a "Controller" 1-5 followed by a "Point" (or relay / input / output) which would be 1 to 64 in the K8000 case.
Or...After selecting the trigger type "Digital In" or out, select an "ID" of a digital that had been previously defined within the "Digital In/Out" screen (which has the controller and point info).
Let me know if this clears it up.
Dave.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: January 14 2005 at 12:43 | IP Logged
|
|
|
Phil,
I'll check out the site and the code.
Thanks,
Dave.
|
Back to Top |
|
|
didi Newbie
Joined: November 29 2001 Location: Belgium
Online Status: Offline Posts: 34
|
Posted: January 14 2005 at 13:01 | IP Logged
|
|
|
Ok Dave, crystalclear now.
I think the last one (with the ID's) is the most 'readable' to edit and make adjustements on afterwards, but that's just my opinion.
Is there any downside to this method (other than the liitle more overhead of referencing the point that's attached to the ID) ?
I think it would be in Powerhome's best interest to make it as 'generic' as possible regarding future support for controllers to come.
Congrat's on the perfect soldering job by the way
Dirk
|
Back to Top |
|
|
phil13 Groupie
Joined: December 19 2004 Location: France
Online Status: Offline Posts: 60
|
Posted: January 20 2005 at 11:04 | IP Logged
|
|
|
Dave,
it is possible for me to test your add-on for K8000 ?
But i could only read/write only digital input/output (the 2 pcf 8574).
Philippe
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: January 20 2005 at 12:49 | IP Logged
|
|
|
Philippe,
I'll be releasing the next beta pretty soon. Im currently working out the Digital in/out triggers as well as the Digital I/O screens.
The K8000 add-on isnt a separate component but rather an integrated controller module within PowerHome. I don't know if it will be of much use to you without actually having a K8000.
However, if the sample test program that comes with the K8000 is capable of controlling the digital in/out of your equipment, then it should work with PowerHome as well since the internal coding and communication routines are essentially the same.
Dave.
|
Back to Top |
|
|
didi Newbie
Joined: November 29 2001 Location: Belgium
Online Status: Offline Posts: 34
|
Posted: March 18 2005 at 15:06 | IP Logged
|
|
|
Dave,
The K8000 alpha version does everything you said it would at a speed far exceeding my expectations.
Like Tony said : Dave, you da man
Dirk
|
Back to Top |
|
|