This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simple LCD program code MCBSTM32 kit board

Hi all I need a simple LCD Program code without any other tasks such as serial and GPIO co that I can see it clearly how it works. I need it badly. I am using MCBSTM32 kit board. Would be grateful if you have simple code for me Thanks

Parents Reply Children
  • Then it's time to start Debugging it!

    It is unlikely in the extreme that anyone will just happen to have a ready-made program that exactly fits your precise requirements - so, whatever happens, you are going to have to learn how to take existing code, understand it, and then modify it to your requirements.
    (either that, or learn to write it from scratch).

    If your modified code is not working, then backtrack to the last point at which it was working - and try to identify where it went wrong!

    See: www.8052.com/.../169331
    And: www.8052.com/.../169455

  • Hi Andy. I would like to start from scratch to build LCD application so that I can understand better, instead of example, like I know which and why to add include and c files. If not, I will be confused. I want to start from strong fondation at the start to build up. Thanks in advance. Surely there are tutorials on how to start from scratch?

  • Yes, there are plenty!

    But what, exactly, do you mean by, "from scratch"

    - Are you already familiar with electronics - particularly digital electronics?

    - Are you already a competent 'C' programmer?

    - Are you already familiar with embedded development in general?

    - Are you already familiar with LCD interfacing in general?

    - Are you already familiar with the STM32?

    etc,...

    It is impossible to advise you how to move on, when we don't know where you're starting from!

  • Hi Thanks for your prompt reply
    - Are you already familiar with electronics - particularly digital electronics?
    Yes I am

    - Are you already a competent 'C' programmer?
    No not so, Just a bit like I know how to declare, build function, but i have yet to go further.

    - Are you already familiar with embedded development in general?
    I am learning. I have worked with microcontrollers before but not so often.

    - Are you already familiar with LCD interfacing in general?
    Yes sort of,

    - Are you already familiar with the STM32?
    i am trying to be familar with STM32.

    I am using Keil MCBSTM32 board

  • Q: Are you already familiar with electronics - particularly digital electronics?
    A: Yes I am

    Good - so you can read & understand schematics & datasheets?

    Q: Are you already a competent 'C' programmer?
    A: No not so...

    There are some general programming books here:
    http://www.keil.com/books/genbooks.asp
    See also: www.accu.org/.../embedded_systems.htm
    And: publications.gbdirect.co.uk/.../
    And, of course, any 'C' textbook!

    Q: - Are you already familiar with embedded development in general?
    A: I am learning...

    There are many online resources; eg,
    http://www.embedded.com
    http://www.eg3.com

    For specifics of using the Keil tools, you will need to refer to the Keil documentation; in particular the introductory material included in your kit, and:
    http://www.keil.com/support/man/docs/gsac/
    http://www.keil.com/support/man/docs/uv4/uv4_ex_hello.htm

    Q: - Are you already familiar with LCD interfacing in general?
    A: Yes sort of

    The requirements of the LCD are completely independent of what is used to drive it - it makes no difference at all to the LCD whether you are using a PIC, an 8051, an STM32, an FPGA, discrete logic,or anything else!

    Q: - Are you already familiar with the STM32?
    A: i am trying to be familar with STM32.

    For support & details of the STM32, you need to go to the ST site:
    www.st.com/.../familiesdocs-110.html

    You WILL need both the Datasheet and the RM0008 Reference Manual - and the ST page also has lods of application notes, examples, etc...

    If you are using the ST Firmware Library, you will also need the documentation for that.

    The Hitex "Insider's Guide to the STM32 ARM® based Microcontroller" is also available for download from www.st.com/.../familiesdocs-110.html

    Keil's ARM-specific booklist is here: http://www.keil.com/books/armbooks.asp

  • Of course, I mean, "loads of..."

  • Thanks. Looks like it will take me time to learn.
    Ok Is that okay with you if I sent you a simple project to find out what I missed out?

    #include <stdio.h>
    #include <stm32f10x_lib.h>                        // STM32F10x Library Definitions
    #include "STM32_Init.h"                           // STM32 Initialization
    #include "LCD.h"                                  // LCD function prototypes
    
    int main (void) {
    
      lcd_init  ();
      lcd_clear ();
      lcd_print (" HELLO DEMO  ");
      set_cursor(0, 1);
      lcd_print ("  http://www.keil.com  ");
    
    }
    

    When I compile the codes, no errors
    When I run, Nothing happened, no changes in the LCD
    When I debug, it stopped at lcd_init function using F11. To come out of the function, I used ctrl+F11, byt it could not come out. My friend says that there should a LCD code placed here in the main.c.

    What do you think?

    Clement

  • Yes, of course it will!
    It takes a great deal of practice and study - just like any other skill!

  • So what does that tell you?

    Where do you need to look closer to find the cause of this problem?

    "My friend says that there should a LCD code placed here in the main.c"

    On what basis does he say that?

    How, specifically, does he think that this will help?