Está en la página 1de 37

code, circuits, & construction

code and fabrication resources for physical computing and networking

Skip to content

Home About this site Code VariablesCircuits Understanding ElectricityBreadboardsMotorsControlling DC MotorsStepper MotorsControllers All About MicrocontrollersInput & OutputDigital Input & OutputAnalog InputAnalog OutputControlling high-current circuitsCommunication Serial CommunicationInterpreting Serial DataMIDIConstruction

88 LED matrix control on an Arduino Mega


Posted on 31 March 2009 by tigoe

Once youve mastered microcontroller programming, you might be tempted to control a lot of LEDs. Lots of people have this desire once they master the basics. Many microcontrollers have a limited number of output pins, however, so you might think that limits how many LEDs you can control. Ive written about a few different methods around this before, in chapter 14 of Physical Computing, and in this tutorial on this the ITP physical computing site. By matrixing your LEDs, you can control many more than the number of pins you have. For example, with the Arduino Duemilanove and earlier models, you had up to 20 digital outputs (13 labeled digital I/O 0 through 13, plus the six analog outputs, which double as digital I/O 14 through 19). With 16 of those, you can control an 88 matrix of LEDs. Thats 64 LEDs. With the Arduino Mega, you have 54 digital I/O pins, so you can control a lot more. This example uses 32 of them to control 2 88 matrices, for a total of 128 LEDs from one controller.

To make this example, youll need:


Arduino Mega Breadboard or prototyping shield. Im using Smart Projects proto shields, which were designed at the same time as the Mega itself. I love them. 88 LED matrix. I got mine in a surplus shop in China, but you can also get them from most electronics retailers male pin headers female pin headers Wires

Step 1: Figure out the LED Matrix pins


The hardest part of this project was figuring out the arrangement of the LED matrix pins. I didnt have a datasheet for the matrix, only the code on the side of the part, HS-788AS. The only useful Google results I got on it were in Chinese, making them less useful to me personally. So I resorted to the oldfashioned method: I opened a notebook, put my multimeter on the diode check setting, and started touching pins. I knew that the 16 pins of the matrix represented rows and columns, and that there are some pretty standard arrangements of pins, like this one I got from a different LED matrix:

Figure 1. A typical LED matrix schematic. Click on any image to see the large version.

My matrix didnt match this pin configuration. But once I got one LED lit up, I knew that my positive meter lead was on a row, and my negative was on a column. Keeping the positive lead in place, I moved the negative lead in order to find the other columns. I found them in fairly quick order from there. Theyre arranged like this:

Figure 2. The pin configurations for my LED matrices (HS-788AS) Caveat: your LED matrix will probably have a different pin arrangement, so read the data sheet, or use the method described above to find them for yourself. Once I knew the pin configuration of the matrix, I connected its pins to the Mega. I had two matrices in hand, and each takes 16 pins, so I figured Id use them both.

Step 2: Connect LED to Mega


To control a matrix, you connect both its rows and columns to your microcontroller. The columns are connected to the LEDs anodes (see Figure 1), so a column needs to be high for any of the LEDs in that column to turn on. The rows are connected to the LEDs cathodes, so the row needs to be low for an individual LED to turn on. If the row and the column are both high or both low, no voltage flows through the LED and it doesnt turn on. To control an individual LED, you set its column high and its row low. To control multiple LEDs in a row, you set the rows high, then take the column high, then set the lows row or high as appropriate; a low row will turn the corresponding LED on, and a high row will turn it off.

It doesnt matter which pins of the microcontroller you connect the rows and columns to, because you can assign things in software. So I connected the pins in a way that made wiring easiest. The bare prototyping boad looks like this:

Figure 3. Mega prototyping shield I added two rows of female headers to mount the matrices on, along with male headers to tie the pins on the low-numbered digital I/O pins (pins 2 through 13) to the matrices, since these pins have connections to other holes right next to them on the board. For the higher numbered I/O pins (pins 22 and above) I used female headers with long pins. Those pins have no other connections to the board, so I needed the female connections to add wires, and the long male pins to connect to the board below. This is what my board looked like after soldering:

Figure 4. The proto shield after soldering headers and wires on. Finally, I added the LED matrices, both facing the same way:

Figure 5. The finished board, with LED matrices. Note the label on both, facing the same way.

Step 3: Program
In order to control the rows and columns easily, I set up an array of rows and an array of columns for each matrix. Each array contains the pin number for the rows or columns of that matrix, in order:
/* Super Duper Knight Rider for Arduino Mega

This example controls two 8x8 LED matrices, lighting one LED at a time, then bouncing back to the beginning.

created 29 Mar 2009 by Tom Igoe

The matrices used are labeled surplus. They are laid out as follows

HS-788AS.

They were bought

(warning: yours might have different pin configurations):

rows are the anodes cols are the cathodes

label HS-788AS is on the left side of the chip _________ col 4 col 2 row 7 row 6 col 1 row 4 ----| ----| ----| ----| ----| ----| |---- row 1 |---- row 2 |---- col 7 |---- row 8 |---- col 5 |---- row 3

col 3 col 6

----| ----|

|---- row 5 |---- col 8

---------

Pin numbers: Matrix 1: 2,3,4,5,6,7,8,9,12,11,12,13, 34, 35, 36, 37

Matrix 2: 22,23,24,25,26,27,28,29,30,31,38,39,41,43,45,47,49,51,53

*/ int row[] = { 22,23,27,49,28,45,43,25};

int col[] = { 47,41,51,39,26,53,24,29};

int row2[] = { 9,8,4,35,3,10,11,6};

int col2[] = { 34,12,36,13,5,37,7,2};

void setup() { for (int thisPin = 0; thisPin < 8; thisPin++) { // initialize the output pins for matrix 1: pinMode(col[thisPin], OUTPUT); pinMode(row[thisPin], OUTPUT); // take the col pins (i.e. the cathodes) high to ensure that // the LEDS are off: digitalWrite(col[thisPin], HIGH);

// initialize the output pins for matrix 2: pinMode(col2[thisPin], OUTPUT); pinMode(row2[thisPin], OUTPUT);

// take the col pins (i.e. the cathodes) high to ensure that

// the LEDS are off: digitalWrite(col2[thisPin], HIGH); } }

void loop() { // light up the first matrix: // iterate over the rows (anodes): for (int thisrow = 0; thisrow < 8; thisrow++) { // take the row pin (anode) high: digitalWrite(row[thisrow], HIGH); // iterate over the cols (cathodes): for (int thiscol = 0; thiscol < 8; thiscol++) { // when the row is high and the col is low, // the LED where they meet turns on: digitalWrite(col[thiscol], LOW); delay(50); // take the col pin (cathode) high to turn the LED off: digitalWrite(col[thiscol], HIGH); } // take the row pin low to turn off the whole row:

digitalWrite(row[thisrow], LOW); }

// light up the second matrix:

// iterate over the rows (anodes): for (int thisrow = 0; thisrow < 8; thisrow++) { // take the row pin (anode) high: digitalWrite(row2[thisrow], HIGH); // iterate over the cols (cathodes): for (int thiscol = 0; thiscol < 8; thiscol++) { // when the row is high and the col is low, // the LED where they meet turns on: digitalWrite(col2[thiscol], LOW); delay(50); // take the col pin (cathode) high to turn the LED off: digitalWrite(col2[thiscol], HIGH); } // take the row pin low to turn off the whole row: digitalWrite(row2[thisrow], LOW); }

// do the same to go backwards, counting backwards:

// second matrix in reverse: for (int thisrow = 7; thisrow > 0; thisrow--) { digitalWrite(row2[thisrow], HIGH); for (int thiscol = 7; thiscol >0; thiscol--) { digitalWrite(col2[thiscol], LOW); delay(50); digitalWrite(col2[thiscol], HIGH); } digitalWrite(row2[thisrow], LOW); } // first matrix in reverse: for (int thisrow = 7; thisrow > 0; thisrow--) { digitalWrite(row[thisrow], HIGH); for (int thiscol = 7; thiscol >0; thiscol--) { digitalWrite(col[thiscol], LOW); delay(50); digitalWrite(col[thiscol], HIGH); }

digitalWrite(row[thisrow], LOW); } }

The first program I wrote was very simple; it just turned on all the LEDs, like so:
void setup() { for (int thisPin = 0; thisPin < 8; thisPin++) { // initialize the output pins for matrix 1: pinMode(row[thisPin], OUTPUT); pinMode(col[thisPin], OUTPUT);

// initialize the output pins for matrix 2: pinMode(row2[thisPin], OUTPUT); pinMode(col2[thisPin], OUTPUT); } }

void loop() { for (int thisPin = 0; thisPin < 8; thisPin++) {

// turn on matrix 1: digitalWrite(row[thisPin], HIGH); digitalWrite(col[thisPin], LOW); // turn on matrix 2: digitalWrite(row2[thisPin], HIGH); digitalWrite(col2[thisPin], LOW); } }

The second program is a bit more complex. It uses two nested for loops, one to scan over the columns and one to scan the rows for each column. It turns on each LED, pauses, then turns it off:
/* Super Duper Knight Rider for Arduino Mega

This example controls two 8x8 LED matrices, lighting one LED at a time, then bouncing back to the beginning.

created 29 Mar 2009 by Tom Igoe

The matrices used are labeled surplus. They are laid out as follows

HS-788AS.

They were bought

(warning: yours might have different pin configurations):

rows are the anodes cols are the cathodes

label HS-788AS is on the left side of the chip _________ col 4 col 2 row 7 row 6 col 1 row 4 col 3 col 6 ----| ----| ----| ----| ----| ----| ----| ----| |---- row 1 |---- row 2 |---- col 7 |---- row 8 |---- col 5 |---- row 3 |---- row 5 |---- col 8

---------

Pin numbers: Matrix 1: 2,3,4,5,6,7,8,9,12,11,12,13, 34, 35, 36, 37

Matrix 2: 22,23,24,25,26,27,28,29,30,31,38,39,41,43,45,47,49,51,53

*/ int row[] = { 22,23,27,49,28,45,43,25};

int col[] = { 47,41,51,39,26,53,24,29};

int row2[] = { 9,8,4,35,3,10,11,6};

int col2[] = { 34,12,36,13,5,37,7,2};

void setup() { for (int thisPin = 0; thisPin < 8; thisPin++) { // initialize the output pins for matrix 1: pinMode(col[thisPin], OUTPUT); pinMode(row[thisPin], OUTPUT); // take the col pins (i.e. the cathodes) high to ensure that // the LEDS are off: digitalWrite(col[thisPin], HIGH);

// initialize the output pins for matrix 2: pinMode(col2[thisPin], OUTPUT); pinMode(row2[thisPin], OUTPUT);

// take the col pins (i.e. the cathodes) high to ensure that // the LEDS are off: digitalWrite(col2[thisPin], HIGH); } }

void loop() { // light up the first matrix: // iterate over the rows (anodes): for (int thisrow = 0; thisrow < 8; thisrow++) { // take the row pin (anode) high: digitalWrite(row[thisrow], HIGH); // iterate over the cols (cathodes): for (int thiscol = 0; thiscol < 8; thiscol++) { // when the row is high and the col is low, // the LED where they meet turns on: digitalWrite(col[thiscol], LOW); delay(50); // take the col pin (cathode) high to turn the LED off: digitalWrite(col[thiscol], HIGH); } // take the row pin low to turn off the whole row: digitalWrite(row[thisrow], LOW); }

// light up the second matrix:

// iterate over the rows (anodes): for (int thisrow = 0; thisrow < 8; thisrow++) { // take the row pin (anode) high: digitalWrite(row2[thisrow], HIGH); // iterate over the cols (cathodes): for (int thiscol = 0; thiscol < 8; thiscol++) { // when the row is high and the col is low, // the LED where they meet turns on: digitalWrite(col2[thiscol], LOW); delay(50); // take the col pin (cathode) high to turn the LED off: digitalWrite(col2[thiscol], HIGH); } // take the row pin low to turn off the whole row: digitalWrite(row2[thisrow], LOW); }

// do the same to go backwards, counting backwards:

// second matrix in reverse:

for (int thisrow = 7; thisrow > 0; thisrow--) { digitalWrite(row2[thisrow], HIGH); for (int thiscol = 7; thiscol >0; thiscol--) { digitalWrite(col2[thiscol], LOW); delay(50); digitalWrite(col2[thiscol], HIGH); } digitalWrite(row2[thisrow], LOW); } // first matrix in reverse: for (int thisrow = 7; thisrow > 0; thisrow--) { digitalWrite(row[thisrow], HIGH); for (int thiscol = 7; thiscol >0; thiscol--) { digitalWrite(col[thiscol], LOW); delay(50); digitalWrite(col[thiscol], HIGH); } digitalWrite(row[thisrow], LOW); } }

Thats the basic idea, and now youve got Knight Rider for 128 LEDs with no extra parts! Enjoy. Heres the whole sketch. Once you have that working, try attaching potentiometers to analog inputs 0 and 1 and run this sketch. Thanks to the good folks at Eyebeam for giving me a comfy place to work while I am on sabbatical!
This entry was posted in arduino/wiring, AVR, circuits and tagged arduino mega, LED matrix. Bookmark the permalink. Controlling Inkjet Printers from a microcontroller A Tale of Two Pongs

6 Responses to 88 LED matrix control on an Arduino Mega


1. Pingback: Arduino Blog Blog Archive 2. Pingback: Daily Research Shared Items - April 1, 2009 3. Pingback: Mega Knight Rider Example | SquareCows 4. Pingback: Controlling two 88 LEDs matrix with Arduino Mega at ArduinoShow.com 5. Pingback: Arduino Mega example | www.gisvold.co.uk 6. Pingback: Th!nk Again Knight Rider effect based on Arduino

Categories

arduino/wiring AVR BX-24 circuits code construction electronics Flash/ActionScript

iPhone java Lantronix Lingo Max/MSP misc OSX pBasic (Basic stamp) Perl PHP PIC PicBasic Pro Processing XBee

Search for:

Search

Meta

Log in Entries RSS Comments RSS WordPress.org

code, circuits, & construction


Proudly powered by WordPress.

Cartel de Leds en ASM


Posted on 14 Septiembre, 2010 by Suky

Aqu voy a mostrar una forma sencilla de hacer un cartel de leds en asm que tendr algunas limitaciones, pero entendiendo como es el funcionamiento y el esfuerzo de ustedes podrn romper esas barreras! Para mostrar un ejemplo sencillo vamos a usar una tabla para guardar el mensaje a mostrar y una sola variable (8 bits) para indicar el largo y control de la posicin a enviar. Por ello el largo del mensaje estar restringido a 255 bytes que se reducen en 6 por la posicin de la tabla en la memoria de programa.La forma de guardar cada letra del mensaje ser la siguiente:

Cada byte indica una columna de la letra, donde un 0 es led apagado y 1 led encendido. Nota: Es una forma de hacerlo, la cual la aprend del amigo BrunoF en uno de sus tantos aportes Luego el mensaje puede ser mayor al cartel utilizado para mostrarlo as que es necesario efectuar un desplazamiento del mensaje sobre el cartel o lo que es lo mismo desplazar el cartel sobre el mensaje. Para ello se utilizar una variable que indica la posicin inicial dentro del mensaje, en la cual comienza a mostrarse en el cartel. Como deseamos que el mensaje sea rotativo el problema se presenta en las ltimas posiciones donde se debe mostrar la parte final del mensaje y empezar a mostrar el inicio Lo que hacemos es dividir en 2 la forma de mostrar el mensaje, cuando Posicin Inicial + Largo del Cartel sea menor a Largo del mensaje y cuando sea mayor:

Bueno, ms o menos se ha explicado como vamos a trabajar con el mensaje, ahora se debe entender como va a funcionar el multiplexo de los leds. Vamos a realizar la multiplexacin por filas, sea que vamos a seleccionar una fila y vamos a actualizar sus valores por medio de registros de desplazamientos. El tiempo de actualizacin no debe superar los 20ms! Para actualizar usaremos una variable que indique que fila ha de actualizarse, por ejemplo para actualizar la fila uno la variable FilaActual ser 00000001. Ahora para saber que valores tenemos que mandar a los registros de desplazamiento iremos tomando cada una de las columnas (PosicionEnviar) a

actualizar, aremos un AND con FilaActual y determinaremos si enviar un 1 o un 0.( PosicionEnviar (AND) FilaActual ) = FilaActual? Si -> Enviamos un 1 No-> Enviamos un 0 Hardware para simulacin:

; CARTEL DE LEDS. de 32x8. ; Si las letras son de 8x8, maxima cantidad de letras en el mensaje 31.; **** Encabezado **** list p=16F628A ; Microcontrolador utilizado.#include P16F628A.inc ; Definicion de registros SFR.__CONFIG _HS_OSC & _PWRTE_ON & _WDT_OFF & _CP_OFF & _MCLRE_ON & _BOREN_OFF & _LVP_OFF & _DATA_CP_OFF ;**** Definicion de Variables **** CBLOCK 0x20 ; En esta posicion se declaran los registros de

usuario (GPR) STATUS_Temp ; Registro para guardar temporalmete STATUS W_Temp ; Registro para guardar temporalmete W Banderas ; Registro para almacenar banderas.FilaActual ; Fila Actual a refrescar.PosicionInicial ; Posicion inicial dentro del mensaje a visualizar en el cartel.- (Entre 0 y LargoMsj-1) PosicionEnviar ; Posicion del registro a enviar.CuentaRefrescos ; Cuenta la cantidad de refrescos realizados. LargoCartel ; Guarda largo del cartel.- 32 LargoMsj ; largo del mesaje a visualizar-> Max 249 Bytes.-Para aumentar modificar manejo de tabla.TempH ; Temporal para guardar calculos matemticos.TempL ; Temporal... VelMovimiento ; Para fijar velocidad de movimiento.ENDC Velocidad equ d'4' ; Para fijar velocidad de desplazamiento.kbhit_tiempo equ 0 ; Bandera que indica que han pasado 2ms.kbhit_cuadro equ 1 BData equ 0 BClock equ 1 Strobe equ 2 ;**** Inicio del Microcontrolador **** Reset org 0x00 goto Inicio ; Salto a inicio del programa.;**** Vector de Interrupcion **** org 0x04 goto Inicio_ISR ; Atiendo Interrupcion.;**** Mensaje a Mostrar ***** org 0x05 Mensaje addwf PCL,1 ; Se incrementa el contador del programa.DT 0x38, 0x7C, 0xFE, 0x82, 0x82, 0x82, 0x44, 0x00 ; C DT 0x60, 0xF4, 0x94, 0x94, 0xFC, 0xF8, 0x00, 0x00 ; a DT 0xFC, 0xFC, 0x08, 0x04, 0x04, 0x00, 0x00, 0x00 ; r DT 0x04, 0xFE, 0xFE, 0x84, 0x40, 0x00, 0x00, 0x00 ; t

DT 0x78, 0xFC, 0x94, 0x9C, 0x58, 0x00, 0x00, 0x00 ; e DT 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; l DT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Espacio DT 0x78, 0xFC, 0x84, 0x48, 0xFE, 0xFE, 0x00, 0x00 ; d DT 0x78, 0xFC, 0x94, 0x9C, 0x58, 0x00, 0x00, 0x00 ; e DT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Espacio DT 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; l DT 0x78, 0xFC, 0x94, 0x9C, 0x58, 0x00, 0x00, 0x00 ; e DT 0x78, 0xFC, 0x84, 0x48, 0xFE, 0xFE, 0x00, 0x00 ; d DT 0x88, 0x9C, 0x94, 0xF4, 0x64, 0x00, 0x00, 0x00 ; s DT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Espacio DT 0x8C, 0x9E, 0xFE, 0xFA, 0x62, 0x00, 0x00, 0x00 ; S DT 0x7C, 0xFC, 0x80, 0x80, 0xFC, 0xFC, 0x00, 0x00 ; u DT 0xFE, 0xFE, 0x10, 0x38, 0x64, 0xC4, 0x80, 0x00 ; k DT 0x04, 0x8C, 0xB8, 0x70, 0x30, 0x08, 0x04, 0x00 ; y DT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Espacio DT 0x82, 0xC1, 0xA1, 0x91, 0xCE, 0x00, 0x00, 0x00 ; 2 DT 0x80, 0x86, 0x85, 0x89, 0x71, 0x00, 0x00, 0x00 ; 5 DT 0xC0, 0x3C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 ; / DT 0x81, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 ; 1 DT 0x7E, 0x81, 0x81, 0x81, 0x7E, 0x00, 0x00, 0x00 ; 0 DT 0xC0, 0x3C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 ; / DT 0x7E, 0x81, 0x81, 0x81, 0x7E, 0x00, 0x00, 0x00 ; 0 DT 0x8E, 0x91, 0x51, 0x71, 0x1E, 0x00, 0x00, 0x00 ; 9 DT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Espacio ;**** Programa principal **** Inicio ;---- Configuraciones ---bsf STATUS,RP0 ; Banco 1.movlw 0xF8 movwf TRISA ;eeeeesss movlw 0x00 movwf TRISB ;ssssssss movlw 0xDF movwf OPTION_REG ; Pull-Up deshabiltado, , Timer0|interno, 1:1 bcf STATUS,RP0 ; Banco 0.movlw 0x07 ; Configuro Comparador Analogico

movwf CMCON ; V1in-=GND, V1in+=GND, C1out=Off| V2in=GND, V2in+=GND, C2out=Off clrf PORTA clrf PORTB movlw 0x4D movwf T2CON ; Timer2: Pre=1:4, Post=1:10 movlw movwf movlw movwf Velocidad ; Cargamos velocidad de desplazamiento.VelMovimiento d'32' ; Cargamos largo del cartel.LargoCartel

movlw d'232' ; Cargamos largo del mensaje.movwf LargoMsj clrf PosicionInicial clrf Banderas movlw 0x01 movwf FilaActual movlw 0x08 movwf CuentaRefrescos clrf bsf bsf bcf bsf bsf Bucle btfss goto bcf call goto PIR1 ; Limpiamos Banderas STATUS,RP0 ; Banco 1.PIE1,TMR2IE ; Habilitamos interrupcion por Timer2 STATUS,RP0 ; Banco 0.INTCON,GIE ; Habilitacion general de interrupciones INTCON,PEIE ; Habilitacion de interrupciones Perifericas

Banderas,kbhit_tiempo ; Se espera a que pasen 2 ms.$-1 Banderas,kbhit_tiempo ActualizarCartel ; Se actuliza fila del cartel.Bucle

;************************************************************************ ** ;**** Rutina de servicio de Interrupcion ****

Inicio_ISR ;---- Guardado de registro W y STATUS ---movwf W_Temp ; Copiamos W a un registro Temporario swapf STATUS,W ; Invertimos nibles de STATUS movwf STATUS_Temp ; Guardamos STATUS en un registro temporal ;---- Interrupciones ---btfsc PIR1,TMR2IF ; Interrupcion por Timer2? goto ISR_TIMER2 ; Si, se trata interrupcion ;............................. Fin_ISR ;---- Restauramos los valores de W y STATUS ---swapf STATUS_Temp,W movwf STATUS swapf W_Temp,f swapf W_Temp,W retfie ;....................... ISR_TIMER2 ; Tratamiento de Interrupcion decfsz CuentaRefrescos,1 ; Se refrescaron las 8 filas (Momento adecuado para realizar algun cambio.-) goto SetBandera ; No, seguimos.. decfsz VelMovimiento,1 ; Si, ya pasaron 16ms x VelMovimiento? goto RecargarData ; No, seguimos... movlw Velocidad ; Recargamos Velocidad movwf VelMovimiento incf PosicionInicial ; Si, incrementamos PosicionInicial para efectuar "movimiento" movfw LargoMsj ; Verificamos si ya se llego al final del Mensaje.subwf PosicionInicial,0 btfss STATUS,Z goto RecargarData clrf PosicionInicial RecargarData movlw 0x01 movwf FilaActual ; No, seguimos.. ; Si, reseteamos PosicionInicial.-

movlw 0x08 movwf CuentaRefrescos SetBandera bsf Banderas,kbhit_tiempo ; Indicamos que han pasado 2 ms, y es necesario actualizar.bcf PIR1,TMR2IF ; Borramos bandera goto Fin_ISR ;....................... ;************************************************************************ * ActualizarCartel ; Es (PosicionInicial + LargoCartel <= LargoMsj)? clrf TempH ; Borramos Byte alto de variable de 16bits temporal.bcf STATUS,C ; Aseguramos que el carry sea 0 :P movfw PosicionInicial ; Sumamos PosicionInicial + largoCartel.addwf LargoCartel,0 ; Y lo guardamos en W.movwf TempL ; Cargamos el resultado bajo en variable temporal.btfsc STATUS,C ; y si hay carry incrementamos registro alto del resultado temporal.incf 255) TempH ; (Esto se da porque el resultado es mayor a

btfsc TempH,0 ; Es mayor a 255? goto $+4 ; (Solo lo hacemos as porque LargoMsj debe ser menor o igual a 255) movfw TempL ; No es mayor a 255, verficamos Byte bajo.subwf LargoMsj,0 btfss STATUS,C goto DividoEnDosPartes ; Es mayor... ;************************************************************************ **** ; Es menor... ; Hay que de la posicion actual sumar el largo de leds y despues comenzar a actualizar el cartel.movfw TempL ; Cargamos posicion de donde comenzar a

cargar mensaje.movwf PosicionEnviar CicloEnvio call EnviaBit ; Se envia bits actual del byte seleccionado.decf PosicionEnviar,1 ; Se decrementa direccionador del byte a enviar.movfw PosicionInicial ; Es igual a la posicion inicial de donde se comienza a visualizar mensaje?? subwf PosicionEnviar,0 btfss STATUS,Z ; goto CicloEnvio ; No, seguimos con el siguiente byte.goto Efectivizamos ; Ahora se habilitar Strobe para efectivizar los cambios y activaremos la Fila correspondiente.;************************************************************************ ****** ; Es mayor... DividoEnDosPartes ;(LargoMsj - PosicionInicial): movfw PosicionInicial subwf LargoMsj,0 movwf TempL ; Guardamos resultado de la resta en registro temporal.;[LargoCartel - (LargoMsj - PosicionInicial)]: movfw TempL subwf LargoCartel,0 movwf PosicionEnviar ; Guardamos desde donde comenzamos a enviar disminuyendo hasta 1... CicloEnvio_1 call EnviaBit ; Se envia bits actual del byte seleccionado.decf PosicionEnviar,1 ; Se decrementa direccionador del byte a enviar.movlw 0x00 subwf PosicionEnviar,0 ; Es igual a 0x00?? btfss STATUS,Z goto CicloEnvio_1 ; Enviamos Segunda parte.movfw LargoMsj

movwf PosicionEnviar CicloEnvio_2 call EnviaBit ; Se envia bits actual del byte seleccionado.decf PosicionEnviar,1 ; Se decrementa direccionador del byte a enviar.movfw PosicionInicial ; Es igual a la posicion inicial de donde se comienza a visualizar mensaje?? subwf PosicionEnviar,0 btfss STATUS,Z goto CicloEnvio_2 ; No, seguimos con el siguiente byte.goto Efectivizamos ; Ahora se habilitar Strobe para efectivizar los cambios y activaremos la Fila correspondiente.;************************************************************************ ************ EnviaBit decf PosicionEnviar,0 ; Cargamos posicion en W del byte a visualizar.call Mensaje ; Cargamos en W el byte actual a refrescar.andwf FilaActual,0 ; Hacemos ByteActual (AND) FilaActual para determinar el bit a enviar.subwf FilaActual,0 ; [ByteActual(AND)FilaActual] - FilaActual, si esto es cero el bit a enviar es 1, sino 0.bcf PORTA,BData ; Primero cargamos un 0.btfsc STATUS,Z ; La operacion anterior es 0? bsf PORTA,BData ; Si, cargamos un 1 en el bit bsf PORTA,BClock ; Generamos clock.nop ; demora bcf PORTA,BClock ;.. return ;.......................................................... Efectivizamos movlw 0xFF ; Descactivamos todas las filas.movwf PORTB bsf PORTA,Strobe de desplazamiento.nop bcf PORTA,Strobe comf FilaActual,0 ; Efectivizamos los datos en los registros

; Complementamos FilaActual para activar

Fila actual a refrescar.movwf PORTB bcf STATUS,C rlf FilaActual,1 actualizacion.return end ; ; Rotamos Fila actual para proxima

Exhibicin de matriz Anaranjado-Verde de 8x8 LED hecha en China


por Tianjin Haisheng Xingguang Technology Co., Ltd.

Ver imagen ms grande Precio Fob: Puerto: US $1.2 - 1.5 / pedazo TIANJIN(XINGANG)

Cantidad de orden mnima: 1000 Pieza/Piezas las pequeas rdenes estn tambin disponibles Condiciones de pago: L/C,T/T,Western Union,Paypal

Contactar Ahora mismo


Enviar un Mensaje a este Proveedor

Google Delicious Facebook Twitter

Ms detalles del Intercambio


Precio Fob: Puerto: US $1.2 - 1.5 / pedazo TIANJIN(XINGANG) 1000 Pieza/Piezas las pequeas rdenes estn tambin disponibles

Cantidad de orden

mnima: Condiciones de L/C,T/T,Western Union,Paypal pago: Capacidad de la 10000 Pieza/Piezas por Da la muestra est disponible fuente: Interno: External de la espuma de la perla: tamao normal del cartn del cartn: los Paquete: 22cm*32cm*20cm Plazo de 10-15 das laborables, segn la cantidad. expedicin:

Detalles del producto


Detalles rpidos
Dimetro del Certificado: SO9001: 2000, ROHS punto: mil&iacute;metro

Especificaciones
Vida til larga Anaranjado-Verde de la exhibicin de matriz de 8x8 LED con ISO9001, ROHS Cara negra, segmento blanco I.C. compatible

Especificaciones Exhibicin Tamao del punto: 3m m Material: GaAsP/la naranja de Gap + Gap se ponen verde Color emitido: Naranja/verde Longitud de onda mxima: nanmetro 635/568 Voltaje delantero: 2.1/2.2 - 2.5/2.5V Grados mximos absolutos Voltaje reverso (Vr): 5 V Remita la corriente (si): 30 mA Corriente delantera mxima (Ifp): 150 mA

Disipacin de energa (paladio): 80 mw Temperatura de funcionamiento (Topr): -40oC a +80oC

Artculos y condiciones de la prueba de confiabilidad:

Falta No. Artculo Condiciones de prueba Prueba Tamao de Juicio Criterios H: +85C 30min 1 Ciclo de la temperatura minuto del 5 L: -55C 30min De alta 2 temperatura/alto Humedad H: +100C 5min 3 Choque termal sec del 10 L: -10C 5min 1000 HORAS CICLO 50 76 PCS derecho del 85C/85% 1000 HORAS 76 PCS Iv<=Ivt*0.5 o Vf>=U o Vf<=L CICLO 50 76 PCS

Horas/ciclo muestra

Vida til de la C.C.

SI = 10 mA

76 PCS

Enve su mensaje a este proveedor

No incluyas informacin como contraseas o nmeros de tarjetas de crdito en un mensaje instantneo. ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI YES SR LET'ME FIND OUT dice: oe man atu te keria encontrar en line oe como es la demulteplexion de la matris causa y por k usaste transistores pnp edison dice: AutoMessage: no joder toy cenando ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI YES SR LET'ME FIND OUT dice: el tu proyecto ajajaa pt k eres atorrante con tu edison dice: jajajaja pero sigue el circuito ps esa wada ta facil mmmm ya mira yo te pongo pnp para k pa corriente positiva baje totalmente hacia los led k estan en la matriz saliendo de la matriz hay resistencias de 120 ohmios esas resitencias van a un integrado k cierra circuito con tierra asi es como se prende casa led ps por filas t columnas ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI YES SR LET'ME FIND OUT dice: sucha ese untegrado no es el registro edison dice: si ps ese es ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI YES SR LET'ME FIND OUT dice: aya pt los tr k io tengo son npn

edison dice: nu ps ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: si melas la kagamos ay edison dice: pero cambialo ps ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: como asi k el colector por el emisor o komo edison dice: nu ps cambia de transistor usa el bd136 ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: ajajaj si melas ay la kage oe io estoy usando el registro cmos de 5v ase la misma huads no edison dice: depende del codigo ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: k el ttl edison dice: por k no usas un ttlk ttl ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: si es la misma huada solo kambia el hc edison dice: no e visto el cmos ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: por el ls edison dice: sino te diria ps ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: tu si edison dice: tons normal ps es la misma weada

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: pt entonses por ley tengo k cambiar esos transisitoeres edison dice: see ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: pt y ahora de donde saco tr en domingo ? edison dice: jajjaaj malvinas ps pero ya ta cerrado tas cagao maana nomas `ps ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: s en las malvinas ? si ps por kj pariro ta serrrado los domingos no oe aliaga habla pair atu house uo y cosmo maana como lokearte pa ver tu proyecto pes edison dice: kkkkk maana no el proyecto se lo deje a la casa del oso ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: sera en la jato de oso entonses edison dice: llamale ps ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: donde esta el proyecto en la jato de oso dices no edison dice: ese weon ta en linea ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: asi aver edison dice: esta conectado en el face ROMEO ROYCE: NO SERAS VIRGEN , PERO ERES MI SANTA MAMI dice: aya aver

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

YES SR LET'ME FIND OUT

También podría gustarte