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 / Hi friends pls help me pls debug the program in HITECH-Compiler and resolve this with simulation circuit plz

Hi friends pls help me pls debug the program in HITECH-Compiler and resolve this with simulation circuit plz

|

Microcontroller › PIC › Hi friends pls help me pls debug the program in HITECH-Compiler and resolve this with simulation circuit plz

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 9 months ago by AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 23, 2014 at 10:01 am #3165
    Ganesh
    Participant

    Hi friends i need proteus similation for this program plz help me

     

     

    #include<pic.h>
    #define _XTAL_FREQ 20e6
    __CONFIG(0x3F3A);
    #define RS RB2
    #define EN RB1
    #define databits PORTD
    /*


    PIC INITIALIZATION


    */
    void pic_init()
    {
        TRISB2 = 0;
        TRISB1 = 0;
        TRISD = 0;
    }
     
    /*


    LCD FUNCTIONS BEGIN


    */
    void LCD_STROBE(void)
    {
        EN = 1;
        __delay_us(1);
        EN = 0;
    }
     
    void data(unsigned char c)
    {
        RS = 1;
        __delay_us(50);
        databits = (c >> 4);
        LCD_STROBE();
        databits = (c);
        LCD_STROBE();
    }
     
    void cmd(unsigned char c)
    {
        RS = 0;
        __delay_us(50);
        databits = (c >> 4);
        LCD_STROBE();
        databits = (c);
        LCD_STROBE();
    }
     
    void clear(void)
    {
        cmd(0x01);
        __delay_ms(2);
    }
     
    void lcd_init()
    {
        __delay_ms(15);
        cmd(0x38);
        __delay_ms(1);
        cmd(0x38);
        __delay_us(100);
        cmd(0x38);
        cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
        cmd(0x28);            // Function set (4-bit interface, 2 lines, 5*7Pixels)
        cmd(0x0c);            // Make cursorinvisible
        clear();            // Clear screen
        cmd(0x6);            // Set entry Mode(auto increment of cursor)
    }
     
    void string(const char *q)
    {
        while (*q) {
            data(*q++);
        }
    }
     
    /*


    LCD END


    */
     
    main()
    {
        __delay_ms(50);
        pic_init();
        lcd_init();
        TRISC = 0;
        while (1) {
            cmd(0x80);
            string("HELLO WORLD");
            cmd(0xc0);
            string("IT IS WORKING:-)");
            
        }
    }

     

    August 30, 2014 at 3:55 am #12094
    AJISH ALFRED
    Participant

    Hi Ganesh,

    A code is always written for a particualar circuit, if you post the code then you are supposed to provide the circuit diagram also.

  • 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

  • Replacement IGBT for DGG4015 for Honda Motorcycle ECU June 14, 2026
  • Mitsubishi Electric IPM module lot code format - how to decode? June 14, 2026
  • TDK Lambda ESS 500-20-11-D-LB-RSTL Parallel Operation June 13, 2026
  • Programmable 1kV DC Power Supply – Budget ~$600 with Display June 13, 2026
  • effect of calibration on s-parameters June 13, 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