YIKES! WHERE TO PUT SUBROUTINE???!?!

Off-topic Or Otherwise...Say/Ask It Here
Aaron01110111
Newbie Pyro
Posts: 8
Joined: Mon Feb 27, 2012 9:17 pm
Location: EARTH 113

YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby Aaron01110111 » Mon Feb 27, 2012 9:43 pm

Howdy Pyro! Been awhile since I been here, my username here was Aaron S M, but its been so long that I'm sure I had a different email at the time LOL and also I can't remember which email I would have had back then .

Anyhow, if you, or anybody here would be so kind as to help answer a few questions, I would be soo gratefull.

Firstly, I am glad to say, LOL, I have created a 4 digit countdown timer. The design I used was originally for a 4511 with the PIC16F84A, Yet I didn't want that, cause I want to have the digital display do some cool light show with the display at some point in time.

So, anyhow I managed (through ALOT of hard work, since I'm defiintly no expert yet, considering I ain't at school and no bodies really bothered to help me at all, so I'm proud that I've gotten this far LOL), anyhow I managed to convert the asm code to just using the PIC.

Since I have done that, my next task I am understaking, is to create a subroutine for that fancy lights display routine, to show at a moment before or after the countdown of the digits.

I've created a subroutine.


Anyways, my problem is, no matter where I place it, in my asm code, two things happen,

One: the fun display light routine goes way too fast to really see it , I was trying to have a second, for each thing I wanted on display. And thought I had written code to do so, but instead it looks like it goes through each light display within one second.!! so it goes too fast.

Second: I don't know where to place it in my digital Timer asm program. I've tried placing it when the alarm is to sound (I dont have an alarm speaker, so I have taken that out of the circuit, but the code Label still exists, because I figured that would be a good place to have my subroutine happen),
yet what happens instead is, it looks as though, zeros on the display remain on display, but the subroutine still tries to go on too, and wayyy to fast ...

I don't know if anyone can help or not.

If not, don't worry. And thank you for taking time to read this post.

I don't choose to use a different PIC at this moment, if anyone is wondering, for reasons of my own.

-Aaron
Last edited by Aaron01110111 on Tue Feb 28, 2012 4:44 pm, edited 1 time in total.

Aaron01110111
Newbie Pyro
Posts: 8
Joined: Mon Feb 27, 2012 9:17 pm
Location: EARTH 113

Re: YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby Aaron01110111 » Tue Feb 28, 2012 4:43 pm

Gone through ALOT of testing , reprogramming, etc. LOL

And I'm pleased to say, that I managed to fix my asm code so that my fun light routine works with the timer no problem!

I placed "BCF INTCON, GIE ; disable interrupts"

at the beginning of my subroutine, then I placed:

"BSF INTCON, GIE ; re-enable interrupts"

at the end of it. , placed "call _(routine name)__"

and replaced the "goto soundalarm" , in the "mainloop" , and voila!!!

now my problem is during my subroutine, the sequence of lights go too quickly, you can see it display the routine but , it goes too fast!!

and it kinda of flickers...

so...I'm going to keep trying to fix that AND also it seems like I still have a problem when i first add batttery power...

i have mclr connected to positive with a 10k resistor, so thats cool. i got a 10 k pull up resistor for my button at RA4, I have capacitors connected to the 4MHZ crystal and ground.

what I don't have is a "100nf" capacitor at "vss" and "vdd" , because :

1 - I don't know what it would look like to hook up (i'm still terrible at reading schematic drrawings, so looking at a real picture is what i'm trying to find but I just cant find it anywhere so I dont know how to hook that up properly.

I have , in my parts box a "100uf" capacitor, the type that has - on one side of the pin, those large round type capacitors. I dont know if thats the same as "nf"....

anyhow my point is, I've read in my research that , THAT could cause a problem when u add battery power, (i have config'd the PIC to have WDT_OFF).

That s the only thing I can think of, and I'd do that with the capacitor if I knew how to hook it right...

Unless its code, I can think of no other reason why it does that.

and as I said, the other problem is flicker through subroutine sequence and it goes too fast through the different light displays that i have in my subroutine, i wanted it to do a display sequence per second, but its alot faster...


any help would be great, time to keep working on this till I get it right.

:)

Aaron01110111
Newbie Pyro
Posts: 8
Joined: Mon Feb 27, 2012 9:17 pm
Location: EARTH 113

Re: YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby Aaron01110111 » Thu Mar 01, 2012 7:59 am

Well , you guessed it perhaps,...(or perhaps not LOL), yet, I have successfully fixed the flicker problem on my Timer!!!

All by my self once again.. And you know what, after this very first successfull PIC experiment of mine? I don't understand the problem people have with assembly language?

I actually find Assembly easier (much easier) than using "c" or somthing like that.

It's hilarious cause from what everybody told me, they all said , that I shouldn't start with assembly, but I figured I should, since the IC I'm using....welll....uses assembly LOL.

So , I'm real proud of myself, cause I ain't educated in this ground.

Oh, I managed to fix the screen flicker by re-writing about half of my sub-routine code. LOL.

I realized I had placed "DECFSZ" in the wrong place. And that I had to actually create some more sub-routines to go along with it.

I can't tell you how many times I found, that to correct a problem, ya just had to really, move a single command word!!!

A video of my Timer can be seen on my friend Tom's youtube channel right here:

http://www.youtube.com/watch?v=PNVuhsQrYhg

The only thing now, is what I said in the second post here, which is, when I place batteries in it the first time of the day, it displays funny things, and I got to take the battery out and place it back in a few times (sometimes alot of times) to get it working properly. But then once its working right, as long as the batteries stay in, its fine.

I've got the 10k pull up resistors, I just don't have any capacitors to ground and power to vdd and vss.

Cause, as I said, I don't know how. Schematics , are still a blur to me LOL.

Well take care Friends.

and happy programming! (taking some time off then , with this new knowledge, I am curious to see what else I can do with PIC's !!!)

-Aaron

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby ThePyroElectro » Thu Mar 01, 2012 6:17 pm

Hahaha, that's super cool!

Sorry I didn't get back to you sooner. If you put a capacitor (1uF or 10uF) between power and ground, I think that will solve your "batteries-in" weird LED output start-up problem.

You should try drawing up a schematic to represent what you built!

Aaron01110111
Newbie Pyro
Posts: 8
Joined: Mon Feb 27, 2012 9:17 pm
Location: EARTH 113

Re: YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby Aaron01110111 » Fri Mar 02, 2012 1:14 pm

Howdy Pyro!!!!

First off,....ahem.....THANKKKK YOUUUUUUU!!!!!!!!

I placed a 1uf capacitor , the neg pin onto the negative power rail, and the positive pin to the positive power rail, and (so far) NO problems!!!

And you know what, my good Friend.....I was JUST about to go into MPLAB for the day and spend the entire day, screwing around with my asm code to try and fix the weird start-up problem.

Then somthing in my gut said "go check pyro's forum, go on", and I was soo happy to see your reply!

I did it and so far...so GREAT!!!!

Also thank you for saying you like that vid on youtube! of my Timer. :)

I would put the schematic up and indeed information and my code as to how to build it, But there's one reason why I won't do that anymore.

Basically a long while ago, (before I got into PIC's), I had figured out how to build a digital timer , using cmos IC's. And , I freely (because I like to see people happy), I shared how to build a timer using such chips as the 4511-4029-555 to make a multi-digit display.

I shared it on a "Sliders" forum. One person eventually decided to take my instructions and (with my williing help), I helped him to build his first timer.

The next thing I know, he's selling sliders timer replica's, and ripping people off.

And what's worse is he's claiming it , on other forums, as HIS DESIGN!!!
when Even I know, not to make such a silly claim, because , the IC's are not designed by him, me or any of us, its designed by micrcochip!


So, I decided this time around, that I better not share my Sliders timer replica information , so that it doesn't happen again. Only One person I HAVE shared it with, my entire design, and asm code and hex code, and that is with Tom, my good Friend.

But I won't share it with anyone else or put it up online,

Cause usually it's the people who want a tv show replica that won't have the desire to build one , and it will usually be some greedy person who will take someone else s instructions, and build it, and then ripp others off .

I don't think that's fair.

That's the reason why I won't share this design. There's too many people trying to make money off of this prop. (just look at youtube, type in "sliders timer" and you'll see).

One person was selling there prop for near 1000 dollars . !!! I mean, c'mon.

Once again, Pyro, I really truely THANK YOU!!! For your helpfull great reply!!! If it wasn't for you, I'd be spending probably the next week trying to change code to fix the problem. LOL.

I'm soo happy! I could keep typing and typing LOL!!!

I really hope God Blesses you my Friend.

Your the Best!

Aaron

(p.s.- I hope you understand why I won't put my schematic up or asm code or such? I trust You Pyro, I don't trust others online though. So putting it up here on a forum, I won't do.
So I hope you understand [please say you do :)]
Last edited by Aaron01110111 on Fri Mar 02, 2012 2:02 pm, edited 3 times in total.

Aaron01110111
Newbie Pyro
Posts: 8
Joined: Mon Feb 27, 2012 9:17 pm
Location: EARTH 113

Re: YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby Aaron01110111 » Fri Mar 02, 2012 1:18 pm

Um, Pyro....THANK YOUUUU!!!! THANK YOUUU!! GOD BLESS YOU!! AND THANK YOUUU!!!


SOOOOO SOOOOOO SOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO MUCH!!!!!!!

:) :) :) :) Still so far SO GREAT!!!

Aaron01110111
Newbie Pyro
Posts: 8
Joined: Mon Feb 27, 2012 9:17 pm
Location: EARTH 113

Re: YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby Aaron01110111 » Fri Mar 02, 2012 1:20 pm

By the way, did I say yet?... THANK YOUUUUU PYRO!!! THE GREATEST HELPER IN THE WHOLE WORLD!!! THANK YOUU THANK YOU!!!


.....I just wanted to make sure I thanked you.

ok. alright. time to calm down and um... relax .

Oh , and Pyro, good buddy, just in case I didn't say so......THANK YOU!!

-Aaron

Aaron01110111
Newbie Pyro
Posts: 8
Joined: Mon Feb 27, 2012 9:17 pm
Location: EARTH 113

Re: YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby Aaron01110111 » Fri Mar 02, 2012 1:23 pm

I also made a music video of that sliders show, its on that same friend of mines channel, its here:

http://www.youtube.com/watch?v=TGXuxPDD ... re=related

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby ThePyroElectro » Fri Mar 02, 2012 6:10 pm

Sure. You're welcome Aaron.

Yea, I know what you mean by being sour about people stealing your stuff.

I made it over that hump a while ago and just decided to put my little projects out there for the world to see (and criticize). I'm sure people copy projects straight from my website for school projects or whatever and I'll never be able to stop that, I just hope they learn something about electronics.

Good luck!

Aaron01110111
Newbie Pyro
Posts: 8
Joined: Mon Feb 27, 2012 9:17 pm
Location: EARTH 113

Re: YIKES! WHERE TO PUT SUBROUTINE???!?!

Postby Aaron01110111 » Sat Mar 03, 2012 10:02 am

Hey Pyro, I put the battery in this morning, and it was difficult to start up again, so what I did, is take out the 1 uf capacitor and put in a 4.7 uf capacitor, it seemed to

start up right away after that. If it happens yet again, the only other capacitor I have in my bitsbox is a 5.6uf, then after that they are all 150 uf and 100 uf lol.

But anyhow, it seems like by taking your suggestion, it does work Alot better to start up than before.

I wonder why placing a capacitor makes so much difference?

Also, thats real cool that your able to put up your projects despite people online stealing ideas.

I don't know if I could do that again. Or at least right now. It happened like only a year ago when that person stole my idea and used it as his "own" and made money off of it. The worse thing is too, is that the timers they sold, were terribly made, and the people who recieved them, only had it work for one day before it stopped working! So I read on a forum recently.

The fact that the individual used my instructions on timer building, to do that, did not make me happy .

So, I'm not as brave as you are, to share designs, but God Bless you for doing so , friend.

and thanks again for helping me out.

-Aaron


Return to “Put'm Here”

Who is online

Users browsing this forum: No registered users and 4 guests