The Philippine Electronics and Technology Forum
February 10, 2012, 01:48:11 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  

Pages: [1]   Go Down
  Print  
Author Topic: [HELP] What program will i use to Assemble/Compile this??  (Read 1136 times)
cyrrah
CR2032 Battery
**

Pogi/Ganda Points: 0
Offline Offline

Posts: 18


« on: January 05, 2010, 09:45:39 AM »

Mga boss patulong po sana ako kung pano at ano gagamitin kung software sa pag assemble/compile nitong code na to..

Nakuha ko po tong code na to sa EPE Magazine.. Para po to sa LED Message Display na featured project doon.. gusto ko po sana subukan.. kaso andaming errors nung inassemble ko gamit ang MPASM..

Sana po matulungan nyo ko.. eto po yung part ng code (hindi kasi kasya dito yung complete code):

Code:
; MASTERMSG480M 26JUN06 - COPYRIGHT JOHN BECKER - EPE MOVING MESSAGE DISPLAY MASTER

; PIC16F628, INTERNAL OSC WDT OFF, POR ON, INTRC 100

; command codes:                              
; 1 Setup PIC ID numbers                      **
; 2 not used                                  **
; 3 get & send on character data block        **
; 4 receive normal data from PC for scrolling **
; 5 clear anim & static flags                 **
; 6 halt display                              **
; 7 receive animate display data from PC      **
; 8 Sync Off                                  **
; 9 Sync On                                   **
; 10 not used by master; only by slaves  ; send on received animate display data    **
; 11 send on anim rate value                  **
; 12 receive message scroll rate              **
; 13 code to select moving message mode       **
; 14 code to select animation mode            **
; 15 code to select static display mode       **
; 16 moving message stop - not used by slaves **
; 17 check PIC IDs      **
; 18 Stop animate mode                        **
; 19 Stop static mode      **
; 20 Run Mode
; 21 Program Mode
; 22 slaves only
; 23 show sync

#DEFINE BANK0 BCF $03,5
#DEFINE BANK1 BSF $03,5

        List P = PIC16F628, R=DEC;
        __CONFIG   h'3F30'

        include P16F628.inc

        CBLOCK
STORE1
STORE2
STORE3
COLUMN0
COLUMN1
COLUMN2
COLUMN3
COLUMN4
COLUMN5
CHARACTER
COUNT1
LOOP
COLUMN0A
COLUMN1A
COLUMN2A
COLUMN3A
COLUMN4A
COLUMN5A
LENGTH
SCROLLRATE
SWITCH
PREVSWITCH
NEWSWITCH
SYNCFLAG
MOVINGFLAG
ANIMRATE
ANIMADDRESS
ANIMSTORE    ; extends to $6F
        ENDC
             ; do not add REGs after ANIMSTORE


PROMVAL .EQU $70    ; in both pages
SPBRG   .EQU $99    ; not in INC file for some odd reason.  Bank 1

; **************

        .ORG 0
        goto GIEOFF
        .ORG 4          ; Interrupt vector address
        goto GIEOFF
        .ORG 5          ; Start of program memory

GIEOFF: BCF INTCON,GIE  ; turn off global interrupts
        BTFSC INTCON,GIE
        goto GIEOFF
        goto START

ROUTEITRUNMODE: movf STORE1,W
        andlw 31
addwf PCL,F
        goto RUNMODE2       ; 0 not used at all
        goto SETUP          ; 1 Setup
        goto RUNMODE2       ; 2 not used at all
        goto GETSTATIC      ; 3 receive & send on static characters to slaves
        goto RECEIVEPC      ; 4 receive normal data from PC for scrolling
        goto CLEARFLAGS     ; 5 clear anim & static flags
        goto RUNMODE2       ; 6 not used in this mode
        goto SENDANIMATION  ; 7 receive and send on Animation to slaves
        goto SENDONSYNC     ; 8 sync off
        goto SENDONSYNC     ; 9 sync on
        goto RUNMODE2       ; 10 not used to receive, slave command only
        goto SENDONANIMRATE ; 11 send on animate rate change to slaves
        goto GETSCROLLRATE  ; 12 moving message scroll rate
        goto MOVINGMODE     ; 13 start moving message
        goto ANIMATIONMODE  ; 14 start animation
        goto STATICMODE     ; 15 static static
goto STOPMOVING     ; 16 stop moving message
        goto CHECKPICIDS    ; 17 Check PIC IDs
goto STOPANIMATE    ; 18 Stop animate mode
goto STOPSTATIC     ; 19 Stop static mode
        goto RUNMODE2       ; 20 Run Mode
        goto RUNMODE2       ; 21 Run Mode
        goto RUNMODE2       ; 22 Run Mode
        goto SHOWSYNC       ; 23 tell slaves to show sync
        goto RUNMODE2       ; 24 Run Mode
        goto RUNMODE2       ; 25 Run Mode
        goto RUNMODE2       ; 26 Run Mode
        goto RUNMODE2       ; 27 Run Mode
        goto RUNMODE2       ; 28 Run Mode
        goto RUNMODE2       ; 29 Run Mode
        goto RUNMODE2       ; 30 Run Mode
        goto RUNMODE2       ; 31 Run Mode

;*******************

TABLE:  movf CHARACTER,W
        andlw 127
addwf PCL,F

        include lcdmtx2.inc"

;*******************

START:  clrf PORTA
        clrf PORTB
        movlw $07
        movwf CMCON

        BANK1
        movlw %11100110     ; RB1 & RB2 for serial, RB7-RB5 switches, RB4 as output test point
;        movlw %00000110     ; RB1 & RB2 for serial, RB7-RB4 leds
        movwf TRISB
        movlw %00010000     ; RA4 as input for PIC mode use
        movwf TRISA
        movlw %00000111     ; timer 1:128, pull-ups on (bit 7 = 0)
        movwf OPTION_REG
        BANK0

        call JOESETBAUD     ; initialise serial BAUD rate etc

;****************** START OF MAIN

MAIN:   clrf PORTB
        clrf STORE1
        clrf STORE2
        clrf STORE3
        
        clrf PORTA
        clrf COUNT1

        clrf COLUMN1A
        clrf COLUMN2A
        clrf COLUMN3A
        clrf COLUMN4A
        clrf COLUMN5A

        clrf SWITCH
        clrf PREVSWITCH
        clrf NEWSWITCH
        clrf MOVINGFLAG
        movlw 8
        movwf SYNCFLAG

CHECKSWITCHMAIN:
        comf PORTB,W     ; invert switch inputs to PORTB
        andlw %11100000                        
        movwf SWITCH     ; any switch press?
        swapf SWITCH,F   ; swap bits 8-4 with bits 3-0
        movf SWITCH,W    ; get switch
        movwf PREVSWITCH ; store as prev switch  

CHKS1:  btfss SWITCH,1   ; is S1 pressed (moving mode)?
        goto CHKS2
        bsf MOVINGFLAG,0 ; yes, set running mode in Master

CHKS2:  btfss SWITCH,2   ; is S2 pressed (animate mode)?
        goto CHKS3       ; no, not animation
        movlw 14
        call TXBYTE      ; yes, activate animate

CHKS3:  btfss SWITCH,3   ; is S3 pressed (static mode)?
        goto LOOP0       ; no, not static
        movlw 15         ; yes, activate static
        call TXBYTE

LOOP0:  movlw 2
        movwf LOOP
        movlw 0
        call PRMGET
        addlw 2
        andlw 127
        movwf LENGTH
        movlw 1
        call PRMGET
        movwf SCROLLRATE

LOOPIT: movf LOOP,W
        call PRMGET
        movwf CHARACTER

        andlw 128
        btfsc STATUS,Z
        goto LOOPIT2
        movf CHARACTER,W
        movwf COLUMN5A
        incf LOOP,F
        movf LOOP,W
        call PRMGET
        movwf COLUMN1
        incf LOOP,F
        movf LOOP,W
        call PRMGET
        movwf COLUMN2
        incf LOOP,F
        movf LOOP,W
        call PRMGET
        movwf COLUMN3
        incf LOOP,F
        movf LOOP,W
        call PRMGET
        movwf COLUMN4
        goto COL0

LOOPIT2: movf SCROLLRATE,W    ; sets scroll delay rate
        movwf COUNT1
        call TABLE

COL0:   btfss MOVINGFLAG,0
        goto RUNMODE1

call SHOWCHAR

        btfss PIR1,RCIF       ; Check for any RX'd data
        goto COL0B
        movf RCREG,W          ; zero ignored - PC turn off/on condition
        btfsc STATUS,Z
        goto COL0B
        movwf STORE1
        goto ROUTEITRUNMODE

COL0B:

; CHECKSWITCHMOVING:
        comf PORTB,W     ; invert switch inputs to PORTB
        andlw %11100000                        
        movwf SWITCH     ; any switch press?
        swapf SWITCH,F   ; swap bits 8-4 with bits 3-0
        movf PREVSWITCH,W  ; get prev switch
        xorwf SWITCH,W     ; is it the same as SWITCH?
        movwf NEWSWITCH    ; store XORed value
        btfsc STATUS,Z
        goto COL0C         ; yes, the same
        goto ROUTESWITCH   ; no, different, so route it


gusto ko lang po malaman kung anong software ang gagamitin ko para dito.. Salamat po!
Logged
The Philippine Electronics and Technology Forum
« on: January 05, 2010, 09:45:39 AM »

 Logged
Kaizer03
Nuclear Reactor
****

Pogi/Ganda Points: 217
Offline Offline

Posts: 4516


C#<-->Android<-->Java


WWW
« Reply #1 on: January 05, 2010, 09:47:11 AM »

MPLAB IDE


get it at http://microchip.com ^_^

assembly language po yan=)
Logged

Lend a hand for those who are in need!=)

Stop Hijacking!=) More Technical Posts!=)
DataSheets are enough to answer your questions! Wink

Kaizer Killer EX Pre-Alpha
cyrrah
CR2032 Battery
**

Pogi/Ganda Points: 0
Offline Offline

Posts: 18


« Reply #2 on: January 05, 2010, 12:19:40 PM »

Salamat po sir -[kaizer]^[gigz09]- . . . tanong lang po, diba from Microchip din ang MPASM?? Ba't po di nya ma assemble tong code na to??

Try ko po tong MPLAB IDE.. Salamat po uli!
Logged
Kaizer03
Nuclear Reactor
****

Pogi/Ganda Points: 217
Offline Offline

Posts: 4516


C#<-->Android<-->Java


WWW
« Reply #3 on: January 05, 2010, 12:42:39 PM »

Salamat po sir -[kaizer]^[gigz09]- . . . tanong lang po, diba from Microchip din ang MPASM?? Ba't po di nya ma assemble tong code na to??

Try ko po tong MPLAB IDE.. Salamat po uli!


yup MPASM is the software in which loads the generated HEX file(object file) of the MPLAB to your PIC MCU... =) MPLAB will compile your Assembly Language into HEX=)
Logged

Lend a hand for those who are in need!=)

Stop Hijacking!=) More Technical Posts!=)
DataSheets are enough to answer your questions! Wink

Kaizer Killer EX Pre-Alpha
cyrrah
CR2032 Battery
**

Pogi/Ganda Points: 0
Offline Offline

Posts: 18


« Reply #4 on: January 05, 2010, 12:49:51 PM »

Ganun pala yun.. Salamat boss! Download ko muna tong MPLAB IDE . . I'll let you know kung ok na.
Logged
cyrrah
CR2032 Battery
**

Pogi/Ganda Points: 0
Offline Offline

Posts: 18


« Reply #5 on: January 14, 2010, 08:09:00 PM »

Mga bossing.. hindi ko parin po ma compile ng tama to.. gamit ko po MPLAB IDE. Ang dami pong error. patulong naman po dito..

Baka po kasi may alam po kayong tamang compiler para dito.. sa tingin ko po kasi walang problema tong code na to kasi galing to sa EPE Mag website at tested na to..

eto po yung link sa code mga bossing..

http://www.epemag3.com/index.php?option=com_docman&task=doc_download&gid=67&Itemid=38

 paki compile po taz post nyo po kung anong compiler ginamit nyo..

Salamat po!
Logged
TinTopHack
Lead Acid Battery
*******

Pogi/Ganda Points: 138
Offline Offline

Gender: Male
Posts: 704


Nothing gold can stay. - Robert Frost


« Reply #6 on: January 14, 2010, 08:34:54 PM »

Can you post the error messages? So we can help you analize what is wrong.
I suggest you take this opportunity to learn by discovering what is wrong and how to solve it.
Sometimes we want to jump to a situation where everything is correct, where there is no problem. In the process, we learn nothing. So are you ready to go through the pains to gain?
Logged

The world, as everybody knows, is analog; unless, of course, it's digitized.
cyrrah
CR2032 Battery
**

Pogi/Ganda Points: 0
Offline Offline

Posts: 18


« Reply #7 on: January 14, 2010, 08:41:57 PM »

madami po talagang error boss.. hindi naman sa tinatamad akong alamin kung ano ang mga errors nato.. gusto ko lang po malaman kung anong compiler/assembler ang gagamitin ko..

sa tingin ko po kasi hindi to sa code kase galing to sa EPE website. Baguhan palang po kasi ako sa PIC programming at gusto kong subukan tong featured project na to..
Logged
TinTopHack
Lead Acid Battery
*******

Pogi/Ganda Points: 138
Offline Offline

Gender: Male
Posts: 704


Nothing gold can stay. - Robert Frost


« Reply #8 on: January 14, 2010, 11:59:12 PM »

madami po talagang error boss.. hindi naman sa tinatamad akong alamin kung ano ang mga errors nato.. gusto ko lang po malaman kung anong compiler/assembler ang gagamitin ko..

sa tingin ko po kasi hindi to sa code kase galing to sa EPE website. Baguhan palang po kasi ako sa PIC programming at gusto kong subukan tong featured project na to..

I did not say na tinatamad ka. But by showing the errors, maybe not all of them just the first 5 or 10 errors, maybe we can help determine if there is something wrong with your MPLAB, settings or whatever.  Inassume mo kaagad na ibang compiler ang kelangan mo. Baka hindi. Baka setting lang ng MPLAB? Part of learning PIC programming is to learn how to use the programming tools.
Logged

The world, as everybody knows, is analog; unless, of course, it's digitized.
cyrrah
CR2032 Battery
**

Pogi/Ganda Points: 0
Offline Offline

Posts: 18


« Reply #9 on: January 15, 2010, 12:28:06 PM »

@TinTopHack

eto po yung karamihan sa mga error boss:

Code:
----------------------------------------------------------------------
Release build of project `I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\mastermsg480M.disposable_mcp' started.
Language tool versions: MPASMWIN.exe v5.34, mplink.exe v4.34
Fri Jan 15 12:34:41 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "D:\MPASM Suite\MPASMWIN.exe" /q /p16F628 "mastermsg480M.asm" /l"mastermsg480M.lst" /e"mastermsg480M.err"

Message[313] I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 38 : CBLOCK constants will start with a value of 0.

Error[112]   I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 71 : Missing operator

Warning[207] I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 76 : Found label after column 1. (.ORG)

Error[108]   I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 76 : Illegal character (0)

Warning[219] I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 125 : Invalid RAM location specified.

Error[105]   I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 129 : Cannot open file (Include File "I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\LCDMTX2.INC"")

Error[112]   I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 135 : Missing operator

Error[128]   I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 139 : Missing argument(s)

Message[302] I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 141 : Register in operand not in bank 0.  Ensure that bank bits are correct.


Error[113]   I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 188 : Symbol not previously defined (TXBYTE)

Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\mastermsg480M.disposable_mcp' failed.
Language tool versions: MPASMWIN.exe v5.34, mplink.exe v4.34
Fri Jan 15 12:35:11 2010
----------------------------------------------------------------------
BUILD FAILED

marami pong ganito.. sa tingin nyo po, ano kaya mga eto?
Logged
TinTopHack
Lead Acid Battery
*******

Pogi/Ganda Points: 138
Offline Offline

Gender: Male
Posts: 704


Nothing gold can stay. - Robert Frost


« Reply #10 on: January 15, 2010, 03:50:43 PM »

OK Thanks.

Pls verify muna if your MPLAB IDE settings are for PIC16F628 because your program is for PIC16F628. If you are not yet fully familiar with MPLAB IDE then this a good time to do it. This is a time investment on your part para later kabisado mo na because I am sure once this project works you will continue to work on othe PIC projects.

You also have a missing file as indicated by:
Error[105]   I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\MASTERMSG480M.ASM 129 : Cannot open file (Include File "I:\THESIS TRASHES\LED MESSAGE DISPLAY CODE\LCDMTX2.INC"")
- you need to have this file. You need to check why it is looking for the file in I: while the rest of your files are in D:

The rest appears to be syntax errors which require some time to study. We wil get back to you regarding the rest.

Cheers! - TTH

Logged

The world, as everybody knows, is analog; unless, of course, it's digitized.
The Philippine Electronics and Technology Forum
   

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
CNC Milling DIY ,gusto kong mag-assemble, kayo ba? « 1 2 ... 24 25 »
Personal, Academic and Commercial Electronics Projects
Siramiko 499 26688 Last post February 08, 2012, 10:33:50 PM
by JojoD818
Sample program running program plus circuit please !! « 1 2 »
Microcontroller/Microprocessor Unit Projects and Programming
Siramiko 31 5009 Last post August 27, 2008, 10:39:14 PM
by paranz
Okay ba yung ready-to-assemble na Sub-woofer Enclosure sa Landmark?
Speakers, Crossover Networks and Baffles
fantom_mayonaise 14 2675 Last post June 28, 2008, 05:27:06 AM
by rommelpm
Projector paano mag assemble
Personal, Academic and Commercial Electronics Projects
ccasiser 1 601 Last post July 17, 2009, 02:39:55 PM
by ajak
Pls. help on my PIC18F2550 compile
PIC Microcontrollers
picuser 5 533 Last post March 21, 2010, 10:06:24 PM
by picuser
how to compile this pspice lm311
Electronics Design Automation and Simulation Softwares
Positron E+ 10 502 Last post June 09, 2010, 03:02:30 PM
by Positron E+
how to assemble video game
Game Consoles, Arcade and Slot Machines
m@r 6 430 Last post March 17, 2011, 07:45:14 AM
by RhUNhA
Powered by MySQL Powered by PHP Powered by SMF 1.1.15 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!