EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / problem with coding

problem with coding

|

Microcontroller › PIC › problem with coding

  • This topic has 1 reply, 2 voices, and was last updated 9 years, 7 months ago by Prabakaran P M.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 9, 2016 at 8:02 am #4455
    firdaus
    Participant

    Hello guys, can you help me i have proplem with this coding…when i want build it using mplab software it says have error … i dont know how to solve it..because i does not learn codding… thanks… 

     

     

    #include<P18F4550.INC>

     

    CONFIG WDT=OFF

    CONFIG MCLRE= ON

    CONFIG DEBUG= ON

    CONFIG LVP=OFF

     

    CONFIG FOSC=INTOSCIO_EC

     

    CONSTANT delay= 0x01

    CONSTANT delay2= 0x05

     

    ORG 0X00

     

    MOVLW 0X0F

    MOVWF      ADCON1

     

    MOVLW 0XFF

    MOVWF      TRISB

     

    MOVLW 0X00

    MOVWF PORTB

     

    MOVLW 0X00

    MOVWF TRISD

     

    MOVLW 0X00

    MOVWF TRISC

     

    MAIN

    MOVLW 0X00

    MOVWF PORTD

     

    MOVLW 0X00

    MOVWF PORTC

     

    BTFSS PORTB,0

    GOTO SW1

     

    BTFSS PORTB,1

    GOTO SW2

    GOTO MAIN

     

     

    SW1

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    RUNS

    MOVLW 0XFC

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XF8

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ RUNS

     

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    SENTS

        MOVLW 0XF0

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XF8

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ SENTS

     

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    LOOPS

    MOVLW 0XF0

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XE0

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ LOOPS

     

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    MOVES

    MOVLW 0XC0

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XE0

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ MOVES

     

    MOVLW 0X00

    MOVWF PORTD

    CALL DELAY

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    BUZZER

    MOVLW 0X01

    MOVWF PORTC

    CALL DELAY

    MOVLW 0X00

    MOVWF PORTC

    CALL DELAY

    DECF COUNT, F

    BNZ BUZZER

     

    GOTO MAIN

     

     

    SW2

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    AGAIN

            MOVLW 0XFF

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XFE

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ AGAIN

     

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    JUMP

    MOVLW 0XFC

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XFE

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ JUMP

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    RUN

    MOVLW 0XFC

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XF8

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ RUN

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    SENT

        MOVLW 0XF0

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XF8

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ SENT

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    LOOP

    MOVLW 0XF0

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XE0

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ LOOP

     

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    MOVE

    MOVLW 0XC0

    MOVWF PORTD

    CALL DELAY

     

    MOVLW 0XE0

    MOVWF PORTD

    CALL DELAY

    DECF COUNT, F

    BNZ MOVE

     

    MOVLW 0X00

    MOVWF PORTD

    CALL DELAY

     

    COUNT EQU 0X25

    MOVLW D'3'

    MOVWF COUNT

    MOVLW 0

    BUZZERS

    MOVLW 0X01

    MOVWF PORTC

    CALL DELAY

    MOVLW 0X00

    MOVWF PORTC

    CALL DELAY

    DECF COUNT, F

    BNZ BUZZERS

     

     GOTO MAIN

    DELAY

    INCFSZ delay

    GOTO DELAY

    INCFSZ delay2

    GOTO DELAY

     

    RETURN

     

    END

    June 27, 2016 at 10:42 am #14016
    Prabakaran P M
    Participant

    I don't think this coding is for MPLAB?????

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • renewed interest in old project I call it WICKED 8 January 23, 2026
  • Expensive hobby January 23, 2026
  • analog logic of shmidt trigger bjt circuit January 23, 2026
  • getting no where fast 8 x 8 led matrix January 23, 2026
  • Micro mouse January 22, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise