Hello all PICers, I am a beginner with PICs, and have completed some basic projects. Currently, I am trying to handle 4 sets of 7 segments through multiplexing. The PortB is used for sending the data to the segments. Control pins used are RB7, Ra0, Ra1 & Ra2. I am using Tony Nixon's idea of toggling the supply to the segments alternately. Pl. look at my code, in the subroutine refreshDisp, bsf and bcf lines does not seem to be working. Thanks for sparing some time to help me out. Friendly Regards, Mansoor Title "MultiPlexing of 7 Segments" list P=16F84 ERRORLEVEL -302 ;supress bank selection messages. __CONFIG 3FF1h ; XT, WATCHDOG TIMER DISABLED RA0 equ 0 ;For selecting the timiming mode RA1 equ 1 ;For selecting the timiming mode PCL equ 02h ;Program Counter Low byte RA2 equ 2 ;for launching the main routine after setting RA3 equ 3 ; for selecting the on or off time 7 segments RA4 equ 4 ;for putting MCU into settings mode TMR0 equ 1 TOIF equ 2 Z equ 2 ;Z bit of the status register STATUS equ 3 RP0 equ 5 PORTA equ 5 PORTB equ 6 INTCON equ 0xB OPTREG EQU 0X81 TRISA EQU 0x85 TRISB equ 0x86 onMode equ 0x0A offMode equ 0x0B seg1 equ 0x0C seg2 equ 0x0D seg3 equ 0x0E seg4 equ 0x0F Count equ 0x10 ; used for Timer Delay org 0h clrf PORTA clrf PORTB bsf STATUS, RP0 ;goto Page1 movlw b'01111' ;PORTA 0,1,2,3 as inputs movwf TRISA ;configure PortA movlw b'10000000' ;PORTB All outputs except Pin 7 movwf TRISB ;configure PortA MOVLW b'11000111' ;1:256 PRESCALER initially MOVWF OPTREG bcf STATUS, RP0 ;goto Page0 clrf onMode clrf offMode Start btfss PORTA,RA3 call SetOnTime btfsc PORTA,RA3 call SetBoth ; call SendData call refreshVals call refreshDisp goto Start SetOnTime movf PORTA,W andlw b'00000011' movwf onMode return SetBoth movf PORTA,W andlw b'00000011' movwf offMode call SetOnTime refreshVals movf onMode,W call DataTable1 movwf seg1 movf onMode,W call DataTable2 movwf seg2 movf offMode,W call DataTable1 movwf seg3 movf offMode,W call DataTable2 movwf seg4 return refreshDisp ; Refresh onTime Segment1 bsf PORTB,7 movf seg1,W movwf PORTB bcf PORTB,7 ; Refresh onTime Segment2 bsf PORTA,RA0 movf seg2,W movwf PORTB bcf PORTA,RA0 ; Refresh offTime Segment1 bsf PORTA,RA1 movf seg3,W movwf PORTB bcf PORTA,RA1 ; Refresh onTime Segment2 bsf PORTA,RA2 movf seg4,W movwf PORTB bcf PORTA,RA2 return TMRDelay clrf TMR0 movlw 0x05 movwf Count TDloop btfss INTCON,TOIF goto TDloop bcf INTCON, TOIF decfsz Count,f goto TDloop return DataTable1 addwf PCL retlw b'00111111' ; Digit 0 retlw b'00000110' ; Digit 1 retlw b'01111101' ; Digit 6 DataTable2 addwf PCL retlw b'01100110' ; Digit 4 retlw b'01111101' ; Digit 6 retlw b'01100110' ; Digit 4 end >From: Jinx >Reply-To: pic microcontroller discussion list >To: PICLIST@MITVMA.MIT.EDU >Subject: Re: [PIC]: PIC software >Date: Thu, 3 Apr 2003 12:50:03 +1200 > > > Is there any kind of interface for the PC that will read directly from > > EEPROM chip? > >PICStart Plus ? > >-- >http://www.piclist.com hint: PICList Posts must start with ONE topic: >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads _________________________________________________________________ Using a handphone prepaid card? Reload your credit online! http://www.msn.com.my/reloadredir/default.asp -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics