Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Sponsor

Zero to 32 bits in 10 minutes.
Take the fast track with Stellaris® ARM© Cortex™-M3 evaluations kits.

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | BasicX | X10Cmd Program

Discussion forum for the BasicX family of microcontroller chips.

X10Cmd Program - gouardopatrick - Feb 2 20:37:46 2009

Hello World of BX-24 !

I have written this little program to control X10 appliance
connected to B3 House Code Device code.
The BX-24 is connected to an XM10E-120 device which send the X10
order to the main 230 V of the house

But nothing work and first I question the cabling of what Pin of BX-
24 should be connected to what pin of the XM10E-120.

I believe that what I have written in comment at the beginning of my
program is correct for the connexion.

So because nothing was working, I disconnected the XM10E-120 and put
some test point like Call PutPin (12,0) and Call PutPin (12,1) and
the Debug.Print CStr(V) increasing the V value every time I go in
the loop.
To be able to have my LED blinking and the V printing, I had to put
in Comment the 3 command Call X10Cmd.

Is this normal ?
Is the X10Cmd Command written in my program correct
Is the In/Out pin of BX-24 and XM10 correctly defined and connected ?

Thanks for your help.

Patrick.

*****************************************

Option Explicit

Public Sub Main()
'This program send data to an XM10E-120
'in order to switch On and Off radiators connected to
'X10 Appliance device with House code from A to D
'And Unit ID from 1 to 8

'Test for B3 Appliance Device

Dim V As Single
V=0.0

'House ID
Const X10_A As Byte = &H6
Const X10_B As Byte = &HE
Const X10_C As Byte = &H2
Const X10_D As Byte = &HA

'Unit ID
Const X10_1 As Byte = &HC
Const X10_2 As Byte = &H1C
Const X10_3 As Byte = &H4
Const X10_4 As Byte = &H14
Const X10_5 As Byte = &H2
Const X10_6 As Byte = &H12
Const X10_7 As Byte = &HA
Const X10_8 As Byte = &H1A

'Commands
Const X10_AllUnitsOff As Byte = &H1
Const X10_AllLightsOn As Byte = &H3
Const X10_On As Byte = &H5
Const X10_Off As Byte = &H7

'Divers
'Pin 8 for Clock from XM10E - BX-24 Input
'Pin 7 for X10 Out from XM10E - Not Used in Our Application
'Pin 6 for X10 Input of XM10E - BX-24 Output

Const Clock_Pin As Byte = 8
Const X10_Out As Byte = 7
Const X10_In As Byte = 6
'Call x10cmd(7, 8, X10_B, X10_3, 2)

Do
Debug.Print CStr(V)
V=V+1.0
Call PutPin(12, 1)
'Call x10cmd(X10_Out, Clock_Pin, X10_B, X10_On, 2)
Call Delay(1.0)
'Call x10cmd(X10_Out, Clock_Pin, X10_B, X10_Off, 2)
Call putpin(12, 0)
Call Delay(1.0)
Loop

End Sub

------------------------------------



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: X10Cmd Program - Thad Larson - Feb 2 22:53:20 2009

I haven't used X10 code in years, but below is the sub that worked for me.=
=A0 I used different pins.=A0 I think that your code is set up to turn on a=
ll receivers with a 'B' house code, but you may want to try different comma=
nds - see link below.=A0 My code below addressed a specific house and key c=
ode.=A0 I address the switch first, then tell it what to do.

In the following link
http://www.x10.com/technology1.htm
there is a distinction between 'off' and 'all off'.=A0 The same with on.

&H1=A0 All Units Off
&HE=A0 All Lights Off=A0 *Try this in your code
&H3=A0 All Lights On=A0 *Try this in your code

For testing purposed, you should also have the X10 interface and the ?lamp?=
attached to the same outlet.=A0 A power strip is good.=A0 When I tested X1=
0 at the university, their electrical wiring was such that X10 didn't work.=
=A0 It did work at home, though it drove me nuts because my touch lamp chan=
ged brightness every time the X10 transmitted.

Hope that helps.=A0 The link above should point you in the right direction.

Thad

'=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 _______________
'___________/ X-10 Turn On=A0 \_____________
Public Sub X10_On(ByVal House_Code As Byte, ByVal Key_Code As Byte)
=A0=A0=A0 Dim X10_On As Byte=20
=A0=A0=A0 X10_On =3D bx0000_0101
=A0=A0=A0 Call X10Cmd(16, 17, House_Code, Key_Code, 5)
=A0=A0=A0 Call Delay(0.1)
=A0=A0=A0 Call X10Cmd(16, 17, House_Code, X10_On, 8)
=A0=A0=A0 Call Delay(0.1)
End Sub
'=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ________________
'___________/ X-10 Turn Off=A0 \_____________
Public Sub X10_Off(ByVal House_Code As Byte, ByVal Key_Code As Byte)
=A0=A0=A0 Dim X10_Off As Byte=20
=A0=A0=A0 X10_Off =3D bx0000_0111
=A0=A0=A0 Call X10Cmd(16, 17, House_Code, Key_Code, 5)
=A0=A0=A0 Call Delay(0.1)
=A0=A0=A0 Call X10Cmd(16, 17, House_Code, X10_Off, 8)
=A0=A0=A0 Call Delay(0.1)
End Sub

--- On Mon, 2/2/09, gouardopatrick wrote:
From: gouardopatrick
Subject: [BasicX] X10Cmd Program
To: b...@yahoogroups.com
Date: Monday, February 2, 2009, 8:37 PM

=20=20=20=20
Hello World of BX-24 !

I have written this little program to control X10 appliance=20

connected to B3 House Code Device code.

The BX-24 is connected to an XM10E-120 device which send the X10=20

order to the main 230 V of the house=20

But nothing work and first I question the cabling of what Pin of BX-

24 should be connected to what pin of the XM10E-120.

I believe that what I have written in comment at the beginning of my=20

program is correct for the connexion.

So because nothing was working, I disconnected the XM10E-120 and put=20

some test point like Call PutPin (12,0) and Call PutPin (12,1) and=20

the Debug.Print CStr(V) increasing the V value every time I go in=20

the loop.

To be able to have my LED blinking and the V printing, I had to put=20

in Comment the 3 command Call X10Cmd.

Is this normal ?

Is the X10Cmd Command written in my program correct

Is the In/Out pin of BX-24 and XM10 correctly defined and connected ?

Thanks for your help.

Patrick.

************ ********* ********* ********* **

Option Explicit

Public Sub Main()

'This program send data to an XM10E-120

'in order to switch On and Off radiators connected to

'X10 Appliance device with House code from A to D

'And Unit ID from 1 to 8

'Test for B3 Appliance Device

Dim V As Single

V=3D0.0

'House ID

Const X10_A As Byte =3D &H6

Const X10_B As Byte =3D &HE

Const X10_C As Byte =3D &H2

Const X10_D As Byte =3D &HA

'Unit ID

Const X10_1 As Byte =3D &HC

Const X10_2 As Byte =3D &H1C

Const X10_3 As Byte =3D &H4

Const X10_4 As Byte =3D &H14

Const X10_5 As Byte =3D &H2

Const X10_6 As Byte =3D &H12

Const X10_7 As Byte =3D &HA

Const X10_8 As Byte =3D &H1A

'Commands

Const X10_AllUnitsOff As Byte =3D &H1

Const X10_AllLightsOn As Byte =3D &H3

Const X10_On As Byte =3D &H5

Const X10_Off As Byte =3D &H7

'Divers

'Pin 8 for Clock from XM10E - BX-24 Input

'Pin 7 for X10 Out from XM10E - Not Used in Our Application

'Pin 6 for X10 Input of XM10E - BX-24 Output

Const Clock_Pin As Byte =3D 8

Const X10_Out As Byte =3D 7

Const X10_In As Byte =3D 6

'Call x10cmd(7, 8, X10_B, X10_3, 2)

Do

Debug.Print CStr(V)

V=3DV+1.0

Call PutPin(12, 1)

'Call x10cmd(X10_Out, Clock_Pin, X10_B, X10_On, 2)

Call Delay(1.0)

'Call x10cmd(X10_Out, Clock_Pin, X10_B, X10_Off, 2)

Call putpin(12, 0)

Call Delay(1.0)

Loop

End Sub

=20=20=20=20=20=20

=20=20=20=20
=20=20=20=20
=09
=09=20
=09
=09

=09
=09
=09
=20=20=20=20=20=20

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )