or... easier way... PICMultiCalc, Timer Helper.
http://www.mister-e.org/pages/utilitiespag.html
255-Value listed in the list, and you're in business
Raise your hand those using it.. at least for timer!!!
OK Darrel![]()
![]()
or... easier way... PICMultiCalc, Timer Helper.
http://www.mister-e.org/pages/utilitiespag.html
255-Value listed in the list, and you're in business
Raise your hand those using it.. at least for timer!!!
OK Darrel![]()
![]()
Last edited by mister_e; - 30th December 2007 at 22:50.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well, I can use the timer now.
I even added a postscale of 1:16 and a prescale of 1:16 so it's interrupt-frequency was about 15Hz. The segments were blinkin visibly. Even then, when I changed 'resume loop' to 'resume' I had no changing data to my display. Only the var's he already had.
So, somehow there is something wrong with the resume command. And I really don't know what it is...
Nah there's no issue with RESUME... i'm trying to analyze the whole program here. yeah i TRY.
Try something... comment out the whole none-ISR code, assign a value to the var used in your ISR, and see if there's any problem. You main loop could be anything like a LED blink. Careful with your delays... you're using ON INTERRUPT...
EDIT:
found 2 X 74HC595 on a really old board here, need to test them first...
Last edited by mister_e; - 31st December 2007 at 00:06.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
EDIT2: Thought i saw that before...![]()
One thing i discover in your code...
You don't increment Counter3 variable.. so it will never jump to Loop... hence maybe why it works when you're using RESUME LOOP...Code:LOOP: I2CRead DS_SDA,DS_SCL,$D0,$00, [sec,MINs,hr,day,date,mon,yr] ' Read Ds1307 If sec.7=1 then goto coldstart If setbutton = 0 then 'if setbutton is pressed _hr=hr _min=MINs _sec=sec gosub SetButtonRelease Gosub SetTimeAndDate 'after release endif counter3=0 repeat 'show the segments for 5 times. pauseus 10 until counter3 > 5 GoTo Loop
Same thing in PauseLoop
andCode:Pauseloop: 'some timedelay counter3=0 repeat pauseus 10 until counter3 > 50 return
I'll wait before building itCode:'------------------------------------ SetButtonRelease: 'delay for button counter3=0 while setbutton=0 pauseus 10 Wend if counter3=>29 then repeat pauseus 10 until counter3 > 70 else goto loop endif Return![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
hi, the counter3 has not to be the problem. It is incremended everytime it go's to the ISR. If you look at the top of the ISR you see:
So it stays in stat loop until the ISR is called for 'counter3' time's.Code:if counter3=>200 then 'number of shiftouts counter3=0 else counter3=counter3+1 endif
So it's a kind of delayloop.
Is there an other wat to go to the ISR at the timerinterrupt then ON INTERRUPT?
I go to try comment the code to a minimize is left and use 'return' at th end of the ISR.
To make clear that there are no mistakes: I tried to make the program work in loops and every time the timerinterrupt sets it's flag jumps it to the ISR to shiftout the displayvalues, afther that it go's back to twere it was en finish the loop so it can start again waiting for a buttonpress.
I'm sorry, I thing it will be tomorrow that this is finished. It's buzy over here...![]()
Last edited by ADCON; - 31st December 2007 at 16:18.
i changed my code now.
the var counter works fine.
This is with only the return-command.Code:LOOP: Sec=12 Mins=34 hr=56 if counter3=>100 then blink=1 else blink=0 endif goto loop end
I'm going to change the loop now. I try to set more gosubs in it, maby it works..
[s]It looks like there is a problem between the I2C and interrupt. Do's I2C also use timer2 for it's clocksignal or something?[/s]
edit:
I found a mistake:
@ loop:
goto coldstart
@ coldstart
return
not all the problems are solved now, but at least return at the end of the ISR dos have any effect!
edit2:
after changing the tris settings to
TRISA=%11111111
TRISB=%11111111
I can make some input with the buttons. The problem now is that it's menu is not working right.
It looks like it just runs the routine for once and not wait for any other input.(possible a mistake when I did change it from only loops to interrrupt I might have did something wrong..). I have to look at that for now..
Last edited by ADCON; - 1st January 2008 at 15:51.
None of I2C function use the internal timer, but they need time to execute. I should be able to build the board today.
Out of curiosity... did you also tried to test it with ISIS?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks