For some time now I keep trying to program my cube. But no success. I think is something that I'm declaring wrong. I have attached a sample of my program to light up a led made by me and my main program (the final one that will go on the cube; it should show on the cube the letters VALHI and numbers 209 and some animations). I have the npn tranzistors that comand the catods on ports A0 A1 A2 A3 A4 and pnp tranzistors that comand the anods on ports B0 all the way to E0 (25 in total). To light up a led I have to activate, let's say layer 1 (A0) by giving 1 and column 1 (B0) by giving 0. It is not a difficult program but I can't just get it to work. I use MPLAB to make the program.
Main program(final one)(it is to long so I'ved upload it on a server): http://www17.zippyshare.com/v/63284413/file.html
Pic of my cube: http://www1.zippyshare.com/v/49857516/file.html
Please help. For any other info just ask me
Program to light up a led:
Thanks
Sorry for my english
Main program(final one)(it is to long so I'ved upload it on a server): http://www17.zippyshare.com/v/63284413/file.html
Pic of my cube: http://www1.zippyshare.com/v/49857516/file.html
Please help. For any other info just ask me
Program to light up a led:
Rich (BB code):
processor 16F877
list f=INHX32
list p=16F877 ; list directive to define processor
include p16f877.inc
__config _hs_osc & _wdt_off & _pwrte_on & _cp_off
radix dec
__config h'3F32' ;OSC is HS
;RB3,RB6,RB7 are I/O
;Brown-out detection OFF
;Power-up timer ON
;Code protection OFF
;Data code protection OFF
;Watchdog timer OFF
errorlevel -302 ;Eliminate bank warning
errorlevel -307 ;Eliminate Setting page bits warning
;----------------------------------------------------------------------
cblock h'20'
cnt100u ;100us counter
endc
;************************ Program Start ***************************
org 0 ;Reset Vector
goto init
;************************ Initial Process *************************
org 6
init
;*** Port initialization
bsf status,rp0 ;Change to Bank1
clrf trisa ;Set RA5-0 to OUTPUT
clrf trisb ;Set RB7-0 to OUTPUT
clrf trisc ;Set RC7-0 to OUTPUT
clrf trisd ;Set RD7-0 to OUTPUT
clrf trise ;Set RE2-0 to OUTPUT
bcf status,rp0 ;Change to Bank0
clrf porta ;Clear PORTA
clrf portb ;Clear PORTB
clrf portc ;Clear PORTC
clrf portd ;Clear PORTD
clrf porte ;Clear PORTE
;***********************************************************************
START: movlw b'00000001'
movwf PORTA
movlw b'11111110'
movwf PORTB
movlw b'11111111'
movwf PORTC
movlw b'11111111'
movwf PORTD
movlw b'00000111'
movwf PORTE
GOTO START
;********************************************************************
; END of Clock display check program
;********************************************************************
end
Thanks
Sorry for my english
Last edited: