--------------Boundary-00=_JXU1QL80000000000000 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =0D Hi Pat,=0D =0D This article uses PICBASIC PRO to achieve what you want, but the hardware issues are beautifully explained. =0D =0D http://www.melabs.com/resources/articles/ledart.htm=0D =0D Referring to this article, I could design a 4 digit multiplexed display i= n my last project successfully.=0D =0D Also consider the fact that your display is going to take up 11 pins on t= he 16F628; is that acceptable? You might want to use a larger PIC.=0D =0D Hope this helps.=0D =0D Regards,=0D =0D Anand Dhuru.=0D =0D =0D -------Original Message-------=0D =0D From: pic microcontroller discussion list=0D Date: Thursday, September 11, 2003 07:57:42=0D To: PICLIST@MITVMA.MIT.EDU=0D Subject: [PIC]: 4-Digit Counter Multiplexing 7-Segment LEDs On 16F628 in = ASM=0D =0D I am still getting my feet wet programming PIC microcontrollers and need=0D help with a project. I would like to build a 4-digit counter using a=0D 16F628. For the oscillator, I would like to use the Internal 4MHz RC.=0D For inputs, I need three push-button switches: Up, Down, and Reset. For=0D output, I need 4 common-cathode 7-segment LED displays. I would like to=0D write code to debounce the switches. This should be a fairly simple=0D project, but at this stage in my PIC experience, it would really help if=0D I could start with someone else's code that works and modify it.=0D =0D To start with, I want to learn to multiplex 4 7-segment LED displays. I=0D know how to write my own code to count from 0-9 on one display,=0D incrementing once per second. Where I am getting stuck is multiplexing=0D 4 displays at once. I have tried the code in AN557, modifying it work=0D with the 16F628. It compiles and partly works. The PORTB outputs go=0D high and low as they should for a one-digit display. PORTA pins remain=0D at ground. So, I can connect the common cathode of one display to=0D ground and it counts up, one digit per second, but only on one display.=0D =0D One problem I am facing is I don't really understand how to use the TMR0=0D interrupt.=0D =0D If anyone is interesting in helping, I have posted the code at:=0D http://www.patrickrichards.com/picmicro/projects/multiplex7seg/multiplex=0D 7seg.asm.=0D =0D If there is a better way for me to approach this problem, any=0D suggestions would be appreciated.=0D =0D I have searched the PICList Archive and while I do see some code for=0D driving 7-segment displays, I couldn't find any I could easily adapt to=0D my needs.=0D =0D Thanks!=0D -Pat=0D =0D --=0D http://www.piclist.com hint: The list server can filter out subtopics=0D (like ads or off topics) for you. See http://www.piclist.com/#topics=0D =2E -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body --------------Boundary-00=_JXU1QL80000000000000 Content-Type: image/gif; name="IMSTP.gif" Content-Transfer-Encoding: base64 Content-ID: R0lGODlhFAAPALMIAP9gAM9gAM8vAM9gL/+QL5AvAGAvAP9gL////wAAAAAAAAAAAAAAAAAAAAAA AAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJFAAIACwAAAAAFAAPAAAEVRDJSaudJuudrxlEKI6B URlCUYyjKpgYAKSgOBSCDEuGDKgrAtC3Q/R+hkPJEDgYCjpKr5A8WK9OaPFZwHoPqm3366VKyeRt E30tVVRscMHDqV/u+AgAIfkEBWQACAAsAAAAABQADwAABBIQyUmrvTjrzbv/YCiOZGmeaAQAIfkE CRQACAAsAgABABAADQAABEoQIUOrpXIOwrsPxiQUheeRAgUA49YNhbCqK1kS9grQhXGAhsDBUJgZ AL2Dcqkk7ogFpvRAokSn0p4PO6UIuUsQggSmFjKXdAgRAQAh+QQFCgAIACwAAAAAFAAPAAAEEhDJ Sau9OOvNu/9gKI5kaZ5oBAAh+QQJFAAIACwCAAEAEAANAAAEShAhQ6ulcg7Cuw/GJBSF55ECBQDj 1g2FsKorWRL2CtCFcYCGwMFQmBkAvYNyqSTuiAWm9ECiRKfSng87pQi5SxCCBKYWMpd0CBEBACH5 BAVkAAgALAAAAAAUAA8AAAQSEMlJq7046827/2AojmRpnmgEADs= --------------Boundary-00=_JXU1QL80000000000000--