Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem with programming pic 16f877

Status
Not open for further replies.

giwrgis2

Newbie level 3
Joined
Apr 13, 2008
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,319
16f877 portc

I request your help! I have a course , and i should program the pic 16f877 for srolling message with dot matrix 5 X 7 . Please help me with the code. I am newbie and all of these seems to me very difficult.
Apology for my bad english
 

trisb 16f877

I found some code to play with the leds, but i don't know if it is ok for my microcontroller, here is the link : **broken link removed**

Also, i have another code witch switch on one led. this is the code:

Program of lighting led connected with a spike



STATUS EQU 3h
PORTB EQU 6h
TRISB EQU 6h

ORG 000h

GOTO START

ORG 010h
START MOVLW b'00100000'
MOVWF STATUS

MOVLW b'11111110'
MOVWF TRISB

MOVLW b'00000000'
MOVWF STATUS

MOVLW b'00000001'
MOVWF PORTB

BACK
GOTO BACK

END



I would like to change it.

I want a programm to turn on the leds(dot matrix) in form of letter



(5x7 dot matrix)

#(=led turn on)

o(=led turn off)

##### #####

oo#oo #oooo

oo#oo #oooo

oo#oo #####

oo#oo #oooo

oo#oo #oooo

oo#oo #####



I would like the code in assembly just above how to write a letter


I have attach a photo for letter " I "

please give me some help..!
 

Hallo again, i found some code (for my pic)to turn on and off one led in port C. Can you help me to turn on - off all the lights in port C?? this is the code :


include "P16f877.inc" ; use definition file for 16F877
;
; --------------------
; USER RAM DEFINITIONS
; --------------------
;
CBLOCK 0x20 ; RAM starts at address 20h
NaHi
NaLo
NbHi
NbLo
ENDC

org 0x0000 ; start address = 0000h

; INITIALISE PORTS
; binary used to see individual pin level

movlw b'00000000' ; all port pins = low
movwf PORTA
movlw b'00000000'
movwf PORTB
movlw b'00000000'
movwf PORTC
movlw b'00000000'
movwf PORTD
movlw b'00000000'
movwf PORTE

bsf STATUS,RP0 ; set RAM Page 1 for TRIS registers

; INITIALISE PORTS
; binary used to see individual pin IO status

movlw b'00000000' ; all IO pins = outputs
movwf TRISA
movlw b'00000000'
movwf TRISB
movlw b'00000000'
movwf TRISC
movlw b'00000000'
movwf TRISD
movlw b'00000000'
movwf TRISE

movlw b'00000110' ; all analog pins = digital
movwf ADCON1

bcf STATUS,RP0 ; back to RAM page 0

; led FLASH LOOP

Loop bsf PORTC,4 ; RC4 = high = led on
call Delay

bcf PORTC,4 ; RC4 = low = led off
call Delay
goto Loop

; 1/2 SEC DELAY SUBROUTINE WITH 4MHz CLOCK

Delay movlw 01h
movwf NbHi
movlw 03h
movwf NbLo
movlw 8Ah
movwf NaHi
movlw 5Bh
movwf NaLo

DeLoop0 decfsz NaLo,F
goto DeLoop0
decfsz NaHi,F
goto DeLoop0
decfsz NbLo,F
goto DeLoop0
decfsz NbHi,F
goto DeLoop0
;
return

end


I will appreciate if you can help me
 

i don't understand what do you mean with "code tags" please give me a more analytic answer. Thank you
 

Don't use quick reply, there is a Code button
Code:
; 1/2 SEC DELAY SUBROUTINE WITH 4MHz CLOCK

Delay movlw 01h
   movwf NbHi
   movlw 03h
   movwf NbLo
   movlw 8Ah
   movwf NaHi
   movlw 5Bh
   movwf NaLo
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top