Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 17th October 2009, 07:31 AM   #61
Default

Quote:
Originally Posted by Mike, K8LH View Post
Hi Suraj,

It seems you have the correct procedure. You need to keep track of the row number and select the correct five bytes (40 bits) of data from your display array during each interrupt. You'll clock out those 40 bits into the daisy-chained shift registers, blank the display, latch the shift register data onto the outputs, then select the new row to turn the display back on. You do this procedure each interrupt to display a new row.

Regards, Mike
Hi Thanks for the help mike.

From your reply I noticed that you have only 5 registers (5bytes) for the 40 column display not 40 registers like I do.
Suraj143 is offline  
Old 17th October 2009, 12:18 PM   #62
Default

Quote:
Originally Posted by Suraj143 View Post
Hi Thanks for the help mike.

From your reply I noticed that you have only 5 registers (5bytes) for the 40 column display not 40 registers like I do.
Hi Suraj,

I use a 35 byte display array, 5 bytes (40 bits) for each of the seven rows, so I must select the correct 5 bytes to send to the shift registers each interrupt.

Why do you have a 40 byte array?

Last edited by Mike, K8LH; 18th October 2009 at 05:11 PM.
Mike, K8LH is offline  
Old 2nd November 2009, 01:09 AM   #63
Default

Mike I have a doubt in your macMUX design. To drive 40 columns you have 5 bytes (40bits) for each row. For 7 rows you have 35bytes.

If you are writing a table pattern for your design what way do you write the table from the below mentioned ways?

See the letter “A” appearing in the table.

Code:
Table	addwf	PCL,F
	retlw	b'00011100'	; char "A"
	retlw	b'00100010'
	retlw	b'00111110'
	retlw	b'00100010'
	retlw	b'00100010'

Table	addwf	PCL,F
	retlw	b'00111111'	; char "A"
	retlw	b'01001000'
	retlw	b'01001000'
	retlw	b'01001000'
	retlw	b'00111111'
	retlw	b'00000000'
__________________
Gayan

My Website
http://gsmicro.blogspot.com/

Last edited by Gayan Soyza; 2nd November 2009 at 01:10 AM.
Gayan Soyza is offline  
Old 2nd November 2009, 09:48 AM   #64
Default

My ROM character arrays are similar to your first example.

Code:
r08 romchar[] = { 0b0111000,    // "0"
                  0b1000100,    //
                  0b1001100,    //
                  0b1010100,    //
                  0b1100100,    //
                  0b0111000,    //
                  ~~~~~~~~~


                  0b0111000,    // "A"
                  0b1000100,    //
                  0b1000100,    //
                  0b1111100,    //
                  0b1000100,    //
                  0b1000100,    //
                  0b1000100,    //
                  0b1111000,    // "B"
                  0b1000100,    //
                  0b1000100,    //
                  0b1111000,    //
                  0b1000100,    //
                  0b1000100,    //
                  0b1111000,    //
                  0b0111000,    // "C"
                  0b1000100,    //
                  0b1000000,    //
                  0b1000000,    //
                  0b1000000,    //
                  0b1000100,    //
                  0b0111000,    //
                  ~~~~~~~~~

Last edited by Mike, K8LH; 2nd November 2009 at 09:50 AM.
Mike, K8LH is offline  
Old 2nd November 2009, 01:15 PM   #65
Default

Ahhhh here now comes the problem..........

In your method it can load a particular byte of a character to the shift register directly.But consider when showing the 2nd character theres a three column gap.How do you overcome this problem mike?

But I see your clock is displaying within the shift register columns nicely.
Attached Thumbnails
LED SignBoard 64X8 - PIC 16F628A-macmux-7x40.png  
__________________
Gayan

My Website
http://gsmicro.blogspot.com/

Last edited by Gayan Soyza; 2nd November 2009 at 01:25 PM.
Gayan Soyza is offline  
Old 2nd November 2009, 01:55 PM   #66
Default

Gayan,

The following text refers to my 7x55 design.

I use a "character generator" subroutine to place the character pixel bits into the display[] array. This sub' will shift and mask the character pattern as necessary according to an 'htab' value of 0..55. The display[] array maps directly to the display hardware, that is, the display[0..6] bytes are row 0 with bit 7 in the display[0] byte mapping to the left most row 0 pixel and bit 0 in the display[6] byte mapping to the right most row 0 pixel. The ISR automatically loads the shift registers from the display[] array, using bytes in display[0..6] for a row 0 update, or bytes in display[7..13] for a row 1 update, etc..

Regards, Mike

Last edited by Mike, K8LH; 2nd November 2009 at 03:18 PM.
Mike, K8LH is offline  
Old 2nd November 2009, 02:44 PM   #67
Default

Quote:
Originally Posted by Mike, K8LH View Post
Gayan,

I use a "character generator" subroutine to place the character pixel bits into the display[] array. This sub' will shift and mask the character pattern as necessary according to an 'htab' value of 0..55. The display[] array maps directly to the display hardware, that is, the display[0..6] bytes are row 0 with bit 7 in the display[0] byte mapping to the left most row 0 pixel and bit 0 in the display[6] byte mapping to the right most row 0 pixel. The ISR automatically loads the shift registers from the display[] array, using bytes in display[0..6] for a row 0 update, or bytes in display[7..13] for a row 1 update, etc..

Regards, Mike
Thanks Mike give me time to think this off.
__________________
Gayan

My Website
http://gsmicro.blogspot.com/
Gayan Soyza is offline  
Old 2nd November 2009, 03:24 PM   #68
Default

Gayan,

May I ask if you're using an array of bytes as a video buffer in your designs? In other words, do you have an ISR which takes data directly from this buffer (array) to "paint" the display hardware and does your 'main' program simply manipulates bits in the video buffer (array)?

Mike

<added>

This may give you an idea of what you need to do with the rom character pattern for the number "2" to place it into the display array (straddling an 8-bit shift register boundary). Seems daunting, doesn't it?
Attached Thumbnails
LED SignBoard 64X8 - PIC 16F628A-mapping.png  

Last edited by Mike, K8LH; 2nd November 2009 at 03:53 PM.
Mike, K8LH is offline  
Old 3rd November 2009, 02:52 AM   #69
Default

Hi Mike thanks for your ideas & time.Now I see what you doing.

My ISR takes data directly from the column registers.The advantage of this method is character placing is very easy even though it takes more RAMs.

Mike couple of questions.

If you need to display a letter let say from 12th column, first you loading 12 & calling your character generator?

What about displaying a word like "MIKE" do you have to send the starting columns of each letter to the character generator?

While traveling I thinked your method its hard mike you have to deal with 14 registers every time when you have to place a letter.
__________________
Gayan

My Website
http://gsmicro.blogspot.com/

Last edited by Gayan Soyza; 3rd November 2009 at 02:58 AM.
Gayan Soyza is offline  
Old 3rd November 2009, 12:46 PM   #70
Default

Gayan,

I just use "htab = 12" to set or change the htab. The character generator automatically advances "htab" by 6 after writing each character to the display buffer so no need to change "htab" for each letter.

Yes, the character generator is a bit more involved when you multiplex rows and it updates 14 bytes in the display buffer for each character but the advantage is that adding columns to this type of multiplexed display does not reduce the LED duty cycle (and brightness).

Mike
Mike, K8LH is offline  
Old 3rd November 2009, 02:45 PM   #71
Default

Mike i'm doing a row scan for larger designs like my last youtube signboard.if i have 64 columns i'm taking 64 registers.in ur method you are taking 56 registers.in isr routine i track the row position & bit mask the appropriate bit & fill the entire row bit by bit .but you are filling entire row byte by byte.thats the different between us.
__________________
Gayan

My Website
http://gsmicro.blogspot.com/
Gayan Soyza is offline  
Old 4th November 2009, 02:30 PM   #72
Default

Hi Gayan,

If I was simply doing a scrolling signboard then I would probably increase the size of the display array (see drawing below) so that one complete character can be built outside of the display area and scrolled into the display one column at a time. Copy the character pattern from rom (table) into those right-most row bytes (no byte boundary problems), scroll one new column at a time into the viewable portion of the display buffer, then do it again for the next character.

The scroll_left routine is simple (and fast);
Code:
void scroll_left_()             // 17 words, 92 cycles
{ u08 i = 7;                    //
  fsr0 = 0x47;                  // fsr0 = &display[7]
  do                            //
  { asm                         //
    { rlcf  _postdec0,F         // scroll row
      rlcf  _postdec0,F         //
      rlcf  _postdec0,F         //
      rlcf  _postdec0,F         //
      rlcf  _postdec0,F         //
      rlcf  _postdec0,F         //
      rlcf  _postdec0,F         //
      movlw 15                  // prep index for next row
      addwf _fsr0l,F            //
    }                           //
    i--;                        //
  } while(i);                   //
}
Pulling a new character pattern from the rom character array (table) and placing it in ram is relatively easy too;
Code:
void getromchar(u08 charval)    // 31 words, 43 cycles
{ asm                           //
  { movlw   7                   // tblptr = @display + charval * 7
    mulwf   _charval            //
    movlw   low(romchar)        //
    addwf   _prodl,W            //
    movwf   _tblptrl            //
    movlw   high(romchar)       //
    addwfc  _prodh,W            //
    movwf   _tblptrh            //
    clrf    _tblptru            //
    tblrd*+                     //
    movff   _tablat,_display+7  // display[7] = romchar[charval*7+0]
    tblrd*+                     //
    movff   _tablat,_display+15 // display[15] = romchar[charval*7+1]
    tblrd*+                     //
    movff   _tablat,_display+23 // display[23] = romchar[charval*7+2]
    tblrd*+                     //
    movff   _tablat,_display+31 // display[31] = romchar[charval*7+3]
    tblrd*+                     //
    movff   _tablat,_display+39 // display[39] = romchar[charval*7+4]
    tblrd*+                     //
    movff   _tablat,_display+47 // display[47] = romchar[charval*7+5]
    tblrd*+                     //
    movff   _tablat,_display+55 // display[55] = romchar[charval*7+6]
  }
}
Attached Thumbnails
LED SignBoard 64X8 - PIC 16F628A-usign-buffer.png  

Last edited by Mike, K8LH; 5th November 2009 at 04:34 PM.
Mike, K8LH is offline  
Old 9th November 2009, 03:50 AM   #73
Default

Hi mike thanks for those wonderful comments.

I just checked your way of doing.Scrolling all 4 ways easy but the problem with character aligning.

I just wrote a character generator subroutine.

Code:
;===========================================================================
;File	-	Char Generator
;Author - 	Gayan Soyza
;Date	-	08-11-2009
;===========================================================================
;Notes
;
;Character Tables must arrange like this starting from MSB

;Char_A		Retlw	b'01110000'		; Letter A
;		Retlw	b'10001000'
;		Retlw	b'10001000'
;		Retlw	b'11111000'
;		Retlw	b'10001000'
;		Retlw	b'10001000'
;		Retlw	b'10001000'

;GP registers used

;Htab		; Horizontal Tab (Starting Column of a char)
;Byte_H		; division byteH - Integer
;Byte_L		; division byteL - fraction
;Rotate_Count	; Rotate couns for make masks
;Mask_1		; mask bits of a char,0 bits will affected by new data 
;Mask_2		; mask bits of a char,0 bits will affected by new data 
;Temp_H		; Temperory byteH for char placing from table
;Temp_L		; Temperory byteL for char placing from table
;Pointer	; offset values to table patterns
;----------------------------------------------------------------------------

Char_Generator	movwf	Htab			; ex: 11th column
		movwf	Byte_H			;
		movlw	b'00000011'		; Make default masks first
		movwf	Mask_1			; 00000011 11111111
		movlw	b'11111111'		;
		movwf	Mask_2
		bcf	STATUS,C
		rrf	Byte_H,F		; divide by 8
		rrf	Byte_L,F
		bcf	STATUS,C
		rrf	Byte_H,F
		rrf	Byte_L,F
		bcf	STATUS,C
		rrf	Byte_H,F		; 00000001 
		rrf	Byte_L,F		; 01100000
		swapf	Byte_L,F
		bcf	STATUS,C
		rrf	Byte_L,F		; 00000011
		;
		movf	Byte_L,W		; remainder = 3
		btfsc	STATUS,Z
		goto	Char_Place_Loop
		movwf	Rotate_Count		; 3
		;
Make_Masks	bsf	STATUS,C
		rrf	Mask_1,F		; 11100000
		rrf	Mask_2,F		; 01111111
		decfsz	Rotate_Count,F
		goto	Make_Masks
		;		
;-----------------------------------------------------------------------------		
		;
Char_Place_Loop	movf	Byte_L,W		; 
		movwf	Rotate_Count
		movf	Byte_H,W		; position register
		addlw	20h
		movwf	FSR			; add the position from 20h		
		movf	Pointer,W
		call	Table			; get the character pattern
		movwf	Temp_H			; store in temp
		movf	Htab,W			; get column
		btfsc	STATUS,Z		; is it zero column ?
		goto	Place_Set_1		; yes,then no need adjust pattern
Adjust_Pattern	bcf	STATUS,C		; no,
		rrf	Temp_H,F
		rrf	Temp_L,F
		decfsz	Rotate_Count,F
		goto	Adjust_Pattern	
		;
Place_Set_1	movf	INDF,W
		andwf	Mask_1,W
		iorwf	Temp_H,W
		movwf	INDF
		;
		incf	FSR,F
Place_Set_2	movf	INDF,W
		andwf	Mask_2,W
		iorwf	Temp_L,W
		movwf	INDF
		decf	FSR,F
		;
		decfsz	Row_Counter,F
		goto	$+4
		movlw	.7
		movwf	Row_Counter
		retlw	0x00			; end of placing a char
		movlw	.6
		addwf	FSR,F
		incf	Pointer,F
		goto	Char_Place_Loop
But I still wondering do I need a character generator.To do a basic scrolling you don't need a Character generator.

I'm doing a research these days what is the speediest way of doing a multiplex routine.
__________________
Gayan

My Website
http://gsmicro.blogspot.com/

Last edited by Gayan Soyza; 9th November 2009 at 03:54 AM.
Gayan Soyza is offline  
Old 9th November 2009, 04:01 AM   #74
Default

Let me tell it again.

Mike I'm doing a row scan.If I want to do a 56 column display I'm taking 56 column registers.But in your case you are taking 49 registers.

The method I'm following doesn't need a character generator & its really easy to place charactors.I'll post a picture for better understanding.
__________________
Gayan

My Website
http://gsmicro.blogspot.com/

Last edited by Gayan Soyza; 9th November 2009 at 04:02 AM.
Gayan Soyza is offline  
Old 9th November 2009, 04:01 AM   #75
Default

That's what I was trying to say -- if all you're doing is scrolling text then you don't need a character generator function. Just stuff your character pattern into the display buffer outside of the viewable area (see diagram in my previous post). There's no alignment problems. You simply copy the seven byte character pattern into the display array.

I'm currently writing a demo' program for you that simply scrolls text based on the design below. Just need to finish creating the rom 5x7 font array (may take awhile). If you have 5x7 modules with anode rows you would swap out the N-FET row drivers with P-FET drivers (also requires a small soft' driver change).

I will look at your code in a moment.

Regards, Mike

Mike, K8LH is offline  
Reply

Tags
64x8, led, pic, signboard

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
10x7 LED SignBoard (MERRY X MAS) Gayan Soyza Micro Controllers 44 10th May 2008 04:49 PM
16f628A - How do I do this? Hakachukai Micro Controllers 6 4th July 2007 05:09 PM
Signboard electronic leticia Micro Controllers 1 18th March 2007 05:01 AM
7X48; 250 character signboard don.vito Micro Controllers 0 4th January 2007 12:11 AM
16f628a RMIM Micro Controllers 8 29th July 2006 08:45 AM



All times are GMT. The time now is 06:10 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker