PDA

View Full Version : HELP with PORTA PIC 16F628A



jams90
- 13th February 2011, 01:49
Im newbie to microcontrollers and picbasic and i'm trying to drive a simple 5x7 led matrix with an 16f628A, i connect the PORTB to the rows and PORTA from PORTA.0 to PORTA.4 to the columns

but the 5th column doesn't show anything.
It's a single 5x7 led matrix.

here's the code:

DEFINE INTOSC
TRISA=0
TRISB=0
loop:
PORTA.0 = 1
PORTB = %01111110 'COLUM DATA
pause 2
PORTA.0 = 0
PORTA.1 = 1
PORTB = %01111110
PAUSE 2
PORTA.1 = 0
PORTA.2 = 1
PORTB = %00000000
PAUSE 2
PORTA.2 = 0
PORTA.3 = 1
PORTB = %01111110
PAUSE 2
PORTA.3 = 0
PORTA.4 = 1
PORTB = %01111110
PAUSE 2
PORTA.4 = 0
GOTO loop
END


i know it could be made easier but im just experimenting with PICBASIC


I wanna make PORTA all DIGITAL OUTPUT


can someone help me?

i just wanna make it show "TE AMO MAMA" letter by letter on the 5x7 led matrix

mackrackit
- 13th February 2011, 05:13
http://www.picbasic.co.uk/forum/showthread.php?t=561

aratti
- 13th February 2011, 07:39
Your column 5 doesn't work simply because PortA.4 is a Schmitt Trigger
input and an open drain output. You will need an additional NPN transistor with a pull down resistor to make column 5 working.

Cheers

Al.

PS adding CMCON = 7 on top of your code, will disable the comparators function.