![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
I have been fine tuning my 5(columns) X 7(rows) matrix system using 74HC164. But still I'm not getting a smooth display result.I'm doubt with the "Clock_Pulse" routine. Code: Do_Show call Reset ;reset 74HC bsf Data ;make 74HC data pin high for the first time movf Col1,W call Clock_Pulse bcf Data ;make 74HC data pin low movf Col2,W call Clock_Pulse movf Col3,W call Clock_Pulse movf Col4,W call Clock_Pulse movf Col5,W call Clock_Pulse goto Do_Show Clock_Pulse movwf Col_Data ;get the column data clrf PORTB bsf Clock ;low to high transition bcf Clock ;make low for next transition movf Col_Data,W movwf PORTB return | |
| |
| | #2 |
|
add a single nop between bsf and bcf Code: ..
bsf Clock ;low to high transition
nop ;give shift register time to act
bcf Clock ;make low for next transition
...
| |
| |
| | #3 |
|
I just checked the DS, the min time for the pulse is 5ns so one nop is enough
| |
| |
| | #4 |
|
Hi arhi thanks for you help. Crystal is 4Mhz.Supply is 5V. The letter is displaying but I can see an additional column.Also I can see the off state LEDs also lights very dimly. I have put an 4.7K pullup resister to the reset pin of 74HC.I think that also better if I can remove and connect that reset pin to direct to PIC. | |
| |
| | #5 |
|
the HC is fast enough for what you need but in general, HCT is faster not that it would make many difference .. you need that nop for the clock ...now, that's what you need to change in the pulse sub ... as for the whole code .. it looks ok ... try with the nop and say if it is ok now | |
| |
| | #6 |
|
Earlier I did my Reset routine like this with tristate condition. Code: Reset bsf STATUS,RP0 bcf TRISA,2 ;make RA2 output bcf STATUS,RP0 ; bcf PORTA,2 ;reset pulse nop ;// nop ;// bsf STATUS,RP0 bsf TRISA,2 ;;make RA2 input bcf STATUS,RP0 return Last edited by Gayan Soyza; 17th February 2009 at 04:57 AM. | |
| |
| | #7 |
|
IIRC reset pin is active low, so if you push up with 10K (or 4.7K, I prefere 10K) and do what you did it should work ... but .. why would you do it ? if you are reserving a pin for reset pin, you do not need to pull-up .. just connect to pic, bcf reset; nop, nop, bsf reset ... and go forward | |
| |
| | #8 |
|
I totally agree with you arhi I'll try with the adjustments & tell the latest progress.
| |
| |
| | #9 |
|
I found what I used to get mine to work Code: Dataout macro Var,Var1 Local Loop movlw .8 movwf Var1 Loop rlf Var,f btfss STATUS,C bcf Data btfsc STATUS,C bsf Data bsf Clock nop nop nop nop bcf Clock decfsz Var1,f goto Loop endm | |
| |
| | #10 |
|
I have change my shift registers 74hc595n it has a latch thay work alot better and only 19cents each
| |
| |
| | #11 |
|
latch is nice but requires extra pin | |
| |
| | #12 |
|
HI be80be thanks for your contribute. By looking at your code can you tell are you feeding the row data via a shift register or direct from PORTB? Last edited by Gayan Soyza; 17th February 2009 at 07:06 AM. | |
| |
| | #13 |
|
here this shows better the macro sends the data out and this shows how it is loaded Code: Main ;main program movlw 0x07 movwf CMCON ;turn comparators off (make it like a 16F84) banksel TRISA movlw b'00011000' ;initializing porta movwf TRISA banksel PORTA clrf PORTA Send movlw b'00000001' ;fill tx buffer movwf TX HC4015 TX,CountSPI goto Send1 Send1 movlw b'00000010' ;fill tx buffer movwf TX HC4015 TX,CountSPI goto Send2 Send2 movlw b'00000100' ;fill tx buffer movwf TX HC4015 TX,CountSPI goto Send3 Send3 movlw b'00001000' ;fill tx buffer movwf TX HC4015 TX,CountSPI goto Send4 Send4 movlw b'00010000' ;fill tx buffer movwf TX HC4015 TX,CountSPI goto Send5 Send5 movlw b'00010000' ;fill tx buffer movwf TX HC4015 TX,CountSPI goto Send6 Send6 movlw b'00100000' ;fill tx buffer movwf TX HC4015 TX,CountSPI goto Send7 Send7 movlw b'01000000' ;fill tx buffer movwf TX HC4015 TX,CountSPI goto Send8 Send8 movlw b'10000000' ;fill tx buffer movwf TX HC4015 TX,CountSPI goto Send Loop Last edited by be80be; 17th February 2009 at 02:39 PM. | |
| |
| | #14 |
|
Hi Arhi I solved my clock pulse routine.You must waste cycles after clearing the PORTB. Also I added that nop as well ![]() Code: ;********************************** ;Clock pulse routine to SR-74HC164 ;********************************** Clock_Pulse movwf Col_Data ;save column data clrf PORTB goto $+1 goto $+1 goto $+1 goto $+1 goto $+1 bsf PORTA,0 ;low to high transition nop bcf PORTA,0 ;make low for next transition nop movf Col_Data,W movwf PORTB goto $+1 goto $+1 return Last edited by Gayan Soyza; 18th February 2009 at 02:58 AM. | |
| |
| | #15 |
|
Now a serious problem I'm having.I spent many hours to solve my new problem but I couldn't do that. I can scroll a letter from right to left slowly.When I make it speed scrolling it displays like mirroring.Not smooth lines moving. I have put a new thread regarding this for assistance. Led Matrix Mirroring Problem. Last edited by Gayan Soyza; 18th February 2009 at 03:31 AM. | |
| |
|
| Tags |
| 74hc164, doubt, register, shift |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| shift register question | stef_eng | Electronic Projects Design/Ideas/Reviews | 1 | 11th October 2008 10:32 PM |
| Shift register | mstechca | General Electronics Chat | 1 | 19th December 2005 12:45 AM |
| EDO RAM as Shift Register | aurosunil | General Electronics Chat | 0 | 17th August 2004 10:25 AM |
| Using Shift Register | toyracer | Electronic Projects Design/Ideas/Reviews | 5 | 13th November 2003 02:19 PM |