X-10 Firecracker Object
MikeS
Posts: 131
I have a need to use the X-10 Firecracker module with the Propeller. I have it working with the Stamp in a similar fashion describe in the attached 2000 article by Al Williams.I did not find a Firecracker Object in the Object listings, does any one have one they would like to share? If not, my question(s) is what would be the steps in creating a Firecracker Object? Would each of Al's subroutines become a separate Method in the Object? Would the Data Block contain the exact same information and structure as the Data Statements in PBasic.
Thanks,
MikeS
Thanks,
MikeS
pdf
118K
Comments
Updated file attached
-- second update added inuse flag
-- third update fixes glaring error in fc_out code (Why didn't anyone bust me on this?)
-- final (hopefully) update attached -- more clean-ups and a few new useful methods (ready for ObEx after testing)
-- see post below for latest version of my object (and demo for it)
As you originality suggested, I spent yesterday writing an object for the Firecracker module but with no success. Last night I saw your posts and tried you FC Object and gave it a try, but had no success either.. I connected the FC back up to the STAMP and it is working fine. I tried looking at the DTR and RTS signal with my old analog scope but couldn't get the wave forms to sync properly to get a good look at them.It does appear that the STAMP DTR and RTS signals are slightly longer in time than what I observed coming from the Propeller running your program or mine.
I appreciate your quick response and willingness to work on the Firecracker Object.
MikeS
BS2 program for testing firecracker module attached
As I have a book project in the works and this may be interesting, I ordered a Firecracker kit. Once it arrives I will connect it and finalize the code.
BTW, could you attach your BS2 code -- what is working on your end -- to your post above so I can look at it in the Stamp editor? With that I can write a demo for you that matches what you're doing; this might help me with testing.
Recently my ActiveHome Pro 2-way PC Interface (CM15A) quit working and I reverted to a CM11A.
I also have several RF transmitters and RR501 wireless receivers.
I also have a TW523 module which works well with the BS2 X10 commands, but the Firecracker should be easier to use.
This should be interesting...
My list of projects I want to get to is already ten miles long without Jon creating another awesome object I want to play with...
/me off to Ebay to grab a Firecracker...
http://wiki.tinyclr.com/index.php?title=X10_Firecracker
[Edit] For those with working hardware perhaps you'll give my demo a try. This uses the latest version of my Firecracker object which lets the caller set the bit timing in the .start() method. The updated object also has a method for taking the house code (alpha, "a".."p"), unit code (1..16), and command (0..3) and converting that to a 16-bit code that is ready for transmission.
The demo program is a parser that lets you enter Firecracker command strings using a terminal. It expects the house code, unit code (for on and off), and a command string (OFF, ON, DIM, BRIGHT). To make it user friendly the parser allows the underscore character between elements. The following strings are examples that will work.
a1on
a_1_off
a_bright
p16_on
(All commands are terminated with CR)
The code is not case-sensitive and the parsing results are displayed by the demo. If the program thinks the command is valid it will be transmitted with the Firecracker. Please keep in mind that the demo is a work-in-progress and not heavily commented. That said, I always try to write obvious code so I don't think anyone will struggle with modifying it to suit their own needs.
I'm still waiting on my eBay purchase so I can only test the code using LEDs. I appreciate any feedback.
I have some BS170 FETs and found this forum thread - do you think this BS170 circuit would work in place of the TC4427?
I also have some CD4050, CD4049 and 74LVC244A level shifter ICs.
Thanks,
- Ron
Thanks,
MikeS
A 7406 is an inverter, a TC4427 is not (it's non-inverting).
I don't know; perhaps using an open-collector output is just not appropriate for the Firecracker. Mine should arrive today; once it's in hand I will validate my code and re-post if necessary.
EDIT: After opening up my module and examining it,
it was obvious that this schematic must be old and does not reflect the current circuit...
The BS2 program prompts the user to "Enter 'y' for interactive mode".
If the BS2 is not connected to the PC or if the user fails to enter a 'y', it goes into demo mode.
Demo mode turns on lights C2 thru C6 and then turns them back off and the program ends.
After C3 is turned on, 6 DIM commands are sent.
Normal mode prompts once for the house code and repeatedly prompts for the unit number (1 thru 16) and the command (on, off, dim, bright).
EDIT: Although not in the 'official' documentation, "ALL LIGHTS ON" and "ALL UNITS OFF" can be handled by the Firecracker. (see code).
Restructured code in v3.
@Jon,
Did you ever get your X10 units? Did it work with the TC4427 as a level shifter?
I converted my BS2 program to SPIN and tried using the BS170 mosfets - it didn't work. I switched to 3.3k ohm resistors on the 5V side with no luck.
I guess you are right - the BS170 circuit won't provide enough current for the Firecracker.
I also converted my BS2 program to PICAXE basic and it works fine - of course I was using 5V with the PICAXE.
Ordered the mosfet after seeing Johns circuit.
OBC
@Jeff
I tried using some different transistors and mosfets with no luck so I also ordered some TC4427A chips.
Jon apparently has used them in several projects other than as mosfet drivers.
MikeS
My second attempt at using BS170 mosfets worked sometimes but the voltage drop (using 5V on the drain) was too much. Also, there was alot of variance between different BS170s - cheap parts maybe?
Here is the SPIN code I created by converting my BS2 code (which works)...
Anyone else get this up and running yet?
OBC
I hope to get my TC4427A ICs today but it might be Monday.
I suppose another way to tackle this would be to remove the PCB from the shell and bypass the diodes to feed 5V directly to the PIC and see if the inputs respond to the 3.3V signals from the Propeller...
OBC
I don't think there is much of a difference -
The TC4427A datasheet says:
http://www.dropbox.com/gallery/7557533/1/firecracker?h=56c054
Maybe one of you guys will see where I'm going wrong.. Gotta be a stupid error on my part.
Second pair of eyes anyone?
OBC
Jeff,
It works great using my program and Jon's schematic.
If your program is using P0 for DTR and P1 for RTS, you might have your yellow and blue wires on the DSUB connector reversed...
Have you tried my code or just Jon's?
I am feeding 5V to the IC - are you trying to use 3V?
I've reversed the DSUB connections just to see if it makes any difference. No dice.
OBC