Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

delay question

Status
Not open for further replies.

daredavel

New Member
im making a multiplexer of two 7seg.. in proteus, a delay of 1, displays gud and nearly invisible to the eyes..but in actual, its blinking..the switching of the 2 displays is quite slow.. can anyone suggest me what to do to solve this? making the switching of the 2 7seg, nearly invisible? thank you!!
 
Last edited:
You need to experiment with the System-->Animation Options, but unless you have a very fast CPU you may not achieve a smooth switching of the 7seg
 
in proteus sir its working fine, but in actual its quite slow.. what should i do sir to make it faster in actual.. im using a 4MHz xtal osc..
 
Decrease the delay in your code. I think you want about 100-120 hz to make it flicker free.
 
good day sir! how can i generate a delay of 30secs or 1min? what is the formula sir to adjust the desired delay? thank you!
 
I found this piece of code elsewhere on this forum.

Write a small routine to call this routine 300 times and you've got 30 seconds ... roughly

I believe this is for a 4mhz clock, if you're running a different speed you'll need to alter your looping code accordingly

Code:
delay3:			movlw	0x2d			;around 0.1 second or a bit less
				movwf	d1
				movlw	0xe7
				movwf	d2
				movlw	0x01
				movwf	d3
delay_0:		decfsz	d1, f
				goto	dd2
				decfsz	d2, f
dd2:			goto	dd3
				decfsz	d3, f
dd3:			goto	delay_0
				return
 
Last edited:
A simpler and easier to understand 100mS delay:

delay: movlw .100 ;around 0.1 second
movwf dd
_mS nop
decfsz delA,f
goto _mS
decfsz dd,f
goto _mS
retlw 00
 
Last edited:
yes, it would seem that the code I posted had been generated by Piclist app. Nice one Wond3rboy ! I tend to frequent Piclist but I've never seen that app, we learn something everyday, so even if Daredavel doesn't come back for the assistance he asked for (he's not been yet) it's helped me ! it's nice to write code to do a job but why re-invent the wheel, if there's an app there to make the code use it I say !

Incidentally, talking of code generators, I've got this site bookmarked in my browser, it's very nice if you haven't seen it yet, it can generate all types of routines.

Dring Engineering Services

I found it because I was looking for Gcode apps as I'm building a cnc so imagine my surprise when I found the PIC routines there, brilliant !

Enjoy.

Keith
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top