AN236 Home Automation Source Code Issues

Post
Gregh
New Member
2009/03/19 10:29:59
Hi all,
 
I came across the AN236 application note while doing research on X10 technology.  Thinking it would be a cool project, I built the circuit and used the supplied source code as-is only making changes to the __CONFIG and any references to the 16f877 to 16f877a.  After much trial and error, I still have not been sucessful in getting the project to work properly.
 
My first question is, has anyone had sucess with the circuit and asm code supplied in AN236?
 
Running in Debug mode I've come accross a few instructions where the software hangs.  With a few small changes, I've taken it as far as getting the LCD to inititalize with the welcome screen and loop in the ISR routine but it does not react to any interupts.
 
This project has too much code to go through in this forum so I'm really looking for people who may have experimented with AN236 and what they found.
 
Thanks!
 
Greg
vkadal
Starting Member
RE: AN236 Home Automation Source Code Issues 2009/03/20 22:20:33
You can report this to support.microchip.com. There will be a reply within 24 hours

V.Kadal Amutham
Gregh
New Member
RE: AN236 Home Automation Source Code Issues 2009/03/23 14:23:40
Smile
 
For anyone interested, I did get the program working.  If your using a PIC16F877A, be sure to follow the code template.  The problem I found with AN236 10Xhc.asm was in the STARTUP code and should be as shown here:
 
 
; Startup Code
;----------------------------------------------------------------------
STARTUP code
  ORG 0x000             ; processor reset vector
 nop     ; nop required for icd
 
 goto Start              ; go to beginning of program

 ORG     0x004             ; interrupt vector location
;*************************************************************************
 
Being new to PIC Programming, this took awhile to figure out.  Hope this helps!
 
 
K8LH
Super Member
RE: AN236 Home Automation Source Code Issues 2009/03/23 15:26:03
So, was the problem that you were trying to run the program in the ICD?


Gregh
New Member
RE: AN236 Home Automation Source Code Issues 2009/03/28 08:34:00
Update on the project.
 
It seems that just adding the "ORG 0x000" is all that was required to have the program run.   Now if I can just get it to keep time.  The time displayed loses a few hours a day. There's a few other bugs as well.  I'm not giving up yet!  Thanks!
 
 
;----------------------------------------------------------------------
; Startup Code
;----------------------------------------------------------------------
STARTUP code
 
 ORG 0x0000
   nop          ; 0x0000  (This nop necessary for ICD operation)
   goto  Start  ; 0x0001
   nop   ; 0x0002
   nop   ; 0x0003
   nop   ; 0x0004
biohazarus
New Member
RE: AN236 Home Automation Source Code Issues 2009/04/01 22:03:20
Hi there,

Could you help me with this problem?

I am starting to work with the X10 with a PIC, but I cannot compile the program?
Error - section 'ISRcode' type is non-overlay and absolute but occurs in more than one input file.

I'm not very experimented with PIC so I don't even know if it is the program, the setup or the guy the problem?!?!?!

I using a PICKit2 with MPLab

I am capable to go on debug mode and droop a line to flickr leds, so I know that my communication is ok.

Thanks for your help,

Alex
post edited by biohazarus - 2009/04/01 22:04:23
znatok
New Member
RE: AN236 Home Automation Source Code Issues 2009/04/01 23:55:43
Hi,
What is the exact Microchip controller used in PICKit2?
The error seams to be programming problem of overlapping Interrupt vectors section with code.

Gregh
New Member
RE: AN236 Home Automation Source Code Issues 2009/04/14 08:26:31
Update on my an236 X10 project for anyone interested. 
 
After much research I have been successful in getting the program to run fairly well and send accurate X10 commands.  The first required important code changes to file x10hc.asm are:
  1. On line 3627 within the UpdateDisplay subroutine, change btfsc to btfss PromptUpdateFlag to check if the flag is set, not cleared.
  2. Change STARTUP code to STARTUP code 0x000
  3. Using a PIC16F877A be sure to add the "A" to the processor type within each file.
  4. For anyone really new to this. Do not include the x10demo.asm file in the project.  This is a seperate program and it won't compile with x10hc.asm

I'm still working on getting the program to keep accurate time and there seems to be missing code for the operation of the light sensor.
 
More to follow!
 
 
yokayzn
New Member
Re: RE: AN236 Home Automation Source Code Issues 2012/05/02 06:38:53
hi Gregh

i am having difficulty - the LCD seems to be stuck on "welcome home"
any idea what the problem is?

any help is appreciated

d
andyc
New Member
RE: AN236 Home Automation Source Code Issues 2012/10/23 13:18:26
Hi, Gregh:
I don't know if I can reach you, because your post was 3 years ago.
I just started X10 project, I meet many difficulties. The designer of X10 left Microchip and Microchip has limited support. Because you succeeded in X10, would you please help me to implement this X10 project? Thank you a lot.
Andy
Foad62
New Member
Re: RE: AN236 Home Automation Source Code Issues 2012/11/25 01:43:45
Hi., yokayzn
I have the same problem as yours, could you find the solution for it?