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 the program....

Status
Not open for further replies.

jabern

Newbie level 6
Joined
Feb 24, 2011
Messages
13
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,446
what's wrong with this program? if i build this on the MPLAB.. the result is failed... why? there's one error... i don't know where is the error.. pls help... me.. this is a 8x10 Led Dot Matrix.. that display... AMATURE RADIO TRANSMITTER CIRCUIT... pls help... i copied this program on youtube.. im a new to this program... the pic that i used is PIC16F84A...

PROCESSOR PIC16F84A
INCLUDE <P16F84A.INC>
RADIX HEX


CBLOCK 20h
DEL
C0
C1
C2
C3
C4
C5
C6
C7
C8
C9
C10
DEL1
TEMP
TIME
ENDC

#DEFINE CLK PORTA,0
#DEFINE REC PORTA,1

ORG 0000h
BCF STATUS,RP0
GOTO MAIN

CLOCK BSF CLK
GOTO $+.1
BCF CLK
RETURN
RESET BSF REC
GOTO $+.1
BCF REC
RETURN

DELAY MOVWF PORTB
DECFSZ DEL,1
GOTO $-.1
CLRF PORTB
CALL CLOCK
RETURN

SHOW CALL RESET
MOVF C0,0
CALL DELAY
MOVF C1,0
CALL DELAY
MOVF C2,0
CALL DELAY
MOVF C3,0
CALL DELAY
MOVF C4,0
CALL DELAY
MOVF C5,0
CALL DELAY
MOVF C6,0
CALL DELAY
MOVF C7,0
CALL DELAY
MOVF C8,0
CALL DELAY
MOVF C9,0
CALL DELAY
RETURN

;******************** AMATURE RADIO TRANSMITTER CIRCUIT ************************

TABLE ADDWF PCL,1 ;Add W to Program Counter
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;A
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;M
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;A
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LEd
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Eh ;U
RETLW 01h
RETLW 01h
RETLW 01h
RETLW 7Eh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;E
RETLW 49h
RETLW 49h
RETLW 41h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED

RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;A
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;D
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 3Eh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh;
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Eh ;0
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 3Eh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;A
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;N
RETLW 20h
RETLW 1Ch
RETLW 02h
RETLW 7Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 32h ;S
RETLW 49h
RETLW 49h
RETLW 49h
RETLW 26h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;M
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh;
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;E
RETLW 49h
RETLW 49h
RETLW 41h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Eh ;C
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 22h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;I
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Eh ;C
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 22h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Eh ;U
RETLW 01h
RETLW 01h
RETLW 01h
RETLW 7Eh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;I
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 0FFh
RETURN


SHIFT MOVF C0,0
MOVWF C9
MOVF C1,0
MOVWF C0
MOVF C2,0
MOVWF C1
MOVF C3,0
MOVWF C2
MOVF C4,0
MOVWF C3
MOVF C5,0
MOVWF C4
MOVF C6,0
MOVWF C5
MOVF C7,0
MOVWF C6
MOVF C8,0
MOVWF C7
MOVF C10,0
MOVWF C8
RETURN

REG MOVLW 20H
MOVWF FSR
CLRF INDF
INCF FSR,1
MOVF FSR,0
BCF STATUS,Z
XORLW 50H
BTFSS STATUS,Z
GOTO $-.6
RETURN


MAIN BSF STATUS,RP0;B1
CLRF TRISB
CLRF TRISA
BCF STATUS,RP0
CALL REG
RUN CALL SHIFT
INCF TEMP,1
MOVF TEMP,0
CALL TABLE
MOVWF C10 ;********
XORLW 0FFH ;********
BTFSC STATUS,Z
GOTO REG
MOVLW .15 ; ****** SPEED SETTING *******
MOVWF DEL1
CALL SHOW
DECFSZ DEL1,1
GOTO $-.2
GOTO RUN
ORG 2007H
DATA 3FF1H
GOTO MAIN

END



what is the dollar sign mean? is it a character in the program? thanks for the help...

---------- Post added at 23:16 ---------- Previous post was at 21:22 ----------

:!::!:help!!!!!!!!:!:
 

What was the error message from the assembler???

The $ sign means the current location, the pc value.
GOTO $-.2 jumps back two locations.
 
  • Like
Reactions: jabern

    jabern

    Points: 2
    Helpful Answer Positive Rating
what shuold be hte correct program so that there will be no error when rebuilding the program? thanks!

---------- Post added at 23:35 ---------- Previous post was at 23:34 ----------

im a newbie for programming... so i dont know what is this all about... we (group) have to make this project.... thanks!
 

What was the error message from the assembler???
 

hi

have you added the assembly program you write to the project?
just copy/paste the error message you saw on MPLAB will make things easier to understand

ml
 

In Mplab, try selecting the option

Project/Set Active Project/None (Quickbuild mode)

Then try to assemble again.
 

Error - section '.org_2' can not fit the absolute section. Section 'org_2' start=0x00002007, length=0x00000004 errors : 1
 

Get rid of the 'GOTO MAIN' at the very end of the program. You don't need it.
The reset vector is at 0.

Address 2007 is the configuration register.
 
  • Like
Reactions: jabern

    jabern

    Points: 2
    Helpful Answer Positive Rating
Thanks btbass... You're excellent... Btbass... Favor pls... Can you help our group pls.. We are a college students.. Hi! Our group want to make a 30x7 led dot matrix.. And our professor dictate us to have a display of on-air and off-air... Because our prof. Want to put that on our campus radio station.. Pls. Help us.. That is our project.. We want a schematic diagram of the circuit and the assembly program.. We are new to this kind of programming.. Pls. Help us! Tnx!
 

Thanks for the flattery guys but this is something I'm sure your professor would like You to do.
Only by doing will you learn which is the point of the exercise.
Google is your friend here for research and if you have any questions or problems,
eda forum is here to help you.
 

haiz... we have no time to study it one by one because our deadline of our project is on Friday this week....



that is a 10x8 dot matrix schematic diagram.... pls. help us to make it 30x7 that display ON-AIR and OFF-AIR.... and using a selecting switch by displaying ON-AIR if it is "On-Air" and selecting the switch again to display "Off-Air"...

This an Example of the display 10x8 Dot Matrix That Display AMATURE RADIO TRANSMITTER CIRCUIT.. this circuit gave to me by the friendly man on youtube.... thanks! anyone there.. pls. Help us on our Project...

PROCESSOR PIC16F84A
INCLUDE <P16F84A.INC>
RADIX HEX


CBLOCK 20h
DEL
C0
C1
C2
C3
C4
C5
C6
C7
C8
C9
C10
DEL1
TEMP
TIME
ENDC

#DEFINE CLK PORTA,0
#DEFINE REC PORTA,1

ORG 0000h
BCF STATUS,RP0
GOTO MAIN

CLOCK BSF CLK
GOTO $+.1
BCF CLK
RETURN
RESET BSF REC
GOTO $+.1
BCF REC
RETURN

DELAY MOVWF PORTB
DECFSZ DEL,1
GOTO $-.1
CLRF PORTB
CALL CLOCK
RETURN

SHOW CALL RESET
MOVF C0,0
CALL DELAY
MOVF C1,0
CALL DELAY
MOVF C2,0
CALL DELAY
MOVF C3,0
CALL DELAY
MOVF C4,0
CALL DELAY
MOVF C5,0
CALL DELAY
MOVF C6,0
CALL DELAY
MOVF C7,0
CALL DELAY
MOVF C8,0
CALL DELAY
MOVF C9,0
CALL DELAY
RETURN

;******************** AMATURE RADIO TRANSMITTER CIRCUIT ************************

TABLE ADDWF PCL,1 ;Add W to Program Counter
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;A
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;M
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;A
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LEd
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Eh ;U
RETLW 01h
RETLW 01h
RETLW 01h
RETLW 7Eh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;E
RETLW 49h
RETLW 49h
RETLW 41h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED

RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;A
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;D
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 3Eh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh;
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Eh ;0
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 3Eh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;A
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;N
RETLW 20h
RETLW 1Ch
RETLW 02h
RETLW 7Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 32h ;S
RETLW 49h
RETLW 49h
RETLW 49h
RETLW 26h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Fh ;M
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh;
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;E
RETLW 49h
RETLW 49h
RETLW 41h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Eh ;C
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 22h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;I
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;R
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 3Eh ;C
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 22h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Eh ;U
RETLW 01h
RETLW 01h
RETLW 01h
RETLW 7Eh
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 7Fh ;I
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 40h ;T
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 00h ; BLANK LED
RETLW 0FFh
RETURN


SHIFT MOVF C0,0
MOVWF C9
MOVF C1,0
MOVWF C0
MOVF C2,0
MOVWF C1
MOVF C3,0
MOVWF C2
MOVF C4,0
MOVWF C3
MOVF C5,0
MOVWF C4
MOVF C6,0
MOVWF C5
MOVF C7,0
MOVWF C6
MOVF C8,0
MOVWF C7
MOVF C10,0
MOVWF C8
RETURN

REG MOVLW 20H
MOVWF FSR
CLRF INDF
INCF FSR,1
MOVF FSR,0
BCF STATUS,Z
XORLW 50H
BTFSS STATUS,Z
GOTO $-.6
RETURN


MAIN BSF STATUS,RP0;B1
CLRF TRISB
CLRF TRISA
BCF STATUS,RP0
CALL REG
RUN CALL SHIFT
INCF TEMP,1
MOVF TEMP,0
CALL TABLE
MOVWF C10 ;********
XORLW 0FFH ;********
BTFSC STATUS,Z
GOTO REG
MOVLW .15 ; ****** SPEED SETTING *******
MOVWF DEL1
CALL SHOW
DECFSZ DEL1,1
GOTO $-.2
GOTO RUN
ORG 2007H
DATA 3FF1H


END
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top