Hi Darrel
I have attached the full code.Can you please look at the device setup,assembly and the real-time clock that I made using Timer1 with 32.678khz crystal.I really tried to make this code work.I have also attached My schematic.
Hi Darrel
I have attached the full code.Can you please look at the device setup,assembly and the real-time clock that I made using Timer1 with 32.678khz crystal.I really tried to make this code work.I have also attached My schematic.
Somehow I don't think you're going to drive your ACS108's like that! Have you read their Datasheet and noticed what it says there? I don't see a COMMON path for a NEGATIVE current to flow in order to turn them on.
Hi Melanie
First of all, I would like to congratulate you for the great job that you are doing in this forum. It really helps guys like me with no experience with microcontroller.
Yes I have seen that problem some time ago and corrected it in my design. But my problem right now is the code. The chip is not performing according to the program.Let me ask you a direct question.
1. I used Timer 1 for real-time clock.Do you see any problem in that module ?
2. I used Time var word and then I used high byte and low byte for hour and minute. Is that Ok?
3. How about the assembly code. Do you think that could make the chips unstable. I tried my best not to live floating inputs.I also put a stabilizing capacitor near the chip b/n Vss and Vdd.I tried to do every thing by the book.
> I tried to do every thing by the book.
Time to consign that book to land-fill.
Darrel has already said that your schematic is screwed. The best code in the world isn't going to make it run and it's pointless even looking at it. Go away, create a circuit that is likely to actually work, then at least when you write some code you've half a chance it might do something sensible. While we're at it, you're using a CAD program, so let's layout the drawing that's easy to read.
YES, I did say that. Many times infact! I just don't remember typing it.
Did you bug my computer again Melanie?
Actually, I found so many problems with the schematic, I didn't want to say anything, for fear I'd have to come up with ways to fix it.
I am however, fairly impressed with the program. Every time I thought I found something wrong, a quick look at the datasheet proved that whomever wrote it, spent a lot of time looking at the datasheets too.
You definately gotta work on that circuit though.
<br>
DT
Oh yeah, I forgot,
The only real problem I found in the program was that the Comparator Interrupt section is resetting the Enable bit instead of the Interrupt Flag.
After the first time through, the comparator won't cause an interrupt anymore. But, it will keep the External Interrupt section from ever executing.<br>
Last edited by Darrel Taylor; - 1st October 2005 at 20:17.
DT
Thank you Darrel for your suggestion ,here is the new code.
COMP_INT BSF _Charger ;porta.0 will be on.it will be used for charging the battery
MOVF CMCON,F ;read and clear comparator mismatch condition
bcf PIR1, CMIF ;clear comparator interrupt flag
movf _hour,w ;*** read hour to w register
addlw 008h ;*** add 8 to hour which is in the w register
movwf _Bat_hour ;move the result to the Bat_hour var
goto Unsave
The schematic was never meant to be published ,it was only for reference.I know this is lame excuse so I am working on it and I will post it ASAP.In the mean time you said you don't like the circuit,good. Which part do you think need improvement/change. I don't ask people to do my leg work for me .All I am asking is for suggestion.
I am a Network Engineer by profession never had formal education in electronics. All the small things I know ,I learned it from internet. I really need to make this project work .Please help.
Bookmarks