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 / PIC16f913 and lcd

PIC16f913 and lcd

|

Microcontroller › PIC › PIC16f913 and lcd

  • This topic has 3 replies, 2 voices, and was last updated 12 years, 6 months ago by Arun Sukumaran.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 20, 2013 at 12:01 pm #2421
    Arun Sukumaran
    Participant

    haiii friends…..

    i m a begginer in PIC…. i tried a code in assembly for LCD with PIC 16F913…. the code is giving output to PORTA while i’m checking it with MPSIM… but after dumping it to PIC the LCD shows only 5×7 blocks but not displaying any character…please anybody help me… i post my code here….

     

     

     

     

        list  p=16f913      ; list directive to define processor
       #include <p16f913.inc>

       org 0x00

         STATUS equ 03h

       PORTA equ 05h
       PORTC equ 07h
       TRISA equ 85h
       TRISB equ 86h
       TRISC equ 87h
       bsf STATUS,05
       bcf STATUS,06

       movlw 07h
       movwf CMCON0
       clrf ANSEL
       clrf PORTA
     
       movlw 0xfc
       movwf TRISC
       bcf STATUS,05
     
       COUNT1 equ 50h
       COUNT2 equ 51h
       R1 equ 22h
       R2 equ 23h
       R3 equ 24h
       R4 equ 25h
       temp equ 26h
     
      start 

     

        movlw 38h
        call mask1
        movlw 28h
        call mask1
        movlw 28h
        call mask1
        movlw 0Ch
        call mask1
        movlw 06h
        call mask1
        movlw 80h
        call mask1
      
        movlw ‘H’
        call mask2
        movlw “a”
        call mask2
        movlw “i”
        call mask2

      here      goto here

      mask1

       

        movwf temp
        movlw 0xf0
        movwf R1
        movlw 0x0f
        movwf R2
        movf temp,w
        andwf R1,1
        swapf R1,1
        andwf R2,1
     
        movf R1,w
        call cmd
        movf R2,w
        call cmd
        return

     

      mask2

       

        movwf temp
        movlw 0xf0
        movwf R3
        movlw 0x0f
        movwf R4
        movf temp,w
        andwf R3,1
        swapf R3,1
        andwf R4,1
      
        movf R3,w
        call dat
        movf R4,w
        call dat
        return
      

     

    cmd 

     
        movwf PORTA
        bcf PORTC,0
        bsf PORTC,1
        call delay
        bcf PORTC,1
        return

     

      dat

        movwf PORTA
        bsf PORTC,0
        bsf PORTC,1
        call delay
        bcf PORTC,1
        return

     

      delay 
      
        movlw d’250′
        movwf COUNT2
      loop4
        movlw d’250′
        movwf COUNT1
      loop3 decfsz COUNT1,1
        goto loop3
        decfsz COUNT2,1
        goto loop4

        return
      
       end
       

       

    May 21, 2013 at 4:45 am #9802
    Arun Sukumaran
    Participant

    please anybody help me…..

    May 21, 2013 at 6:04 pm #9807
    AJISH ALFRED
    Participant

    Hi Arun,

    If you are getting black boxes in LCD, that means your LCD is not getting initialized. Most probably the issue is in your circuit connections. Please check the connections for any short cicuit or loose contact or misconnections.

    May 22, 2013 at 4:35 am #9809
    Arun Sukumaran
    Participant

    hi ajish….

     

    i checked it with another hex file(i have only the hex file)…. its working properly….

    do you checked my initialisation section in the code…. is there any problem…

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

RSS Recent Posts

  • What is involved to convert a small town to fiber optic? December 13, 2025
  • Measuring controller current output with a meter December 13, 2025
  • Oshonsoft MSSP simulation question December 13, 2025
  • Droplet1 December 12, 2025
  • Help to Identify capacitor fault December 12, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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