MikroC Nokia1100LCD

Discussion in 'Embedded Systems and Microcontrollers' started by MikroPIC, Jan 19, 2015.

  1. MikroPIC

    Thread Starter New Member

    Jan 19, 2015
    23
    0
    Hi every body ..
    I manage to operate Nokia 1100 LCD with Pic16F84a
    but only for normal text size , i need to write different text sizes and drawing graphics such as circles , boxes
    and write integers , floats , I know very little about programming LCD , i work on MikroC and Pic16f family
    any help would be much appreciated .
     
  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,884
    1,005
    Have you heard of google or bing? It is a tool that lets you search the internet. Go to www.google.com and type in "MikroC Graphics Library Nokia".
     
  3. MikroPIC

    Thread Starter New Member

    Jan 19, 2015
    23
    0
    I think you didn't get what i have said , i cant get from google "any example on MikroC" belongs to Nokia1100LCD
    I only got about nokia other LCDs not about Nokia1100LCD , So Mr googler save your advice to your self ;)
     
  4. MikroPIC

    Thread Starter New Member

    Jan 19, 2015
    23
    0
    Hi guys ..
    any body can help ?
     
  5. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,884
    1,005
    Doubtful you will find help here with anything that specific, No one is going to help you step by step and certainly you will not find someone in
    less than 40 minutes at a time when most people are sleeping.

    This took me 5 seconds to find

    http://www.circuitvalley.com/2011/09/nokia-1100-lcd-interfacing-with.html


    There are tons more. They might not all be in Mikro C but there are some things you wioll need to figure out on your own. If you get stuck on a step then post back with specific information and the question.
     
  6. MikroPIC

    Thread Starter New Member

    Jan 19, 2015
    23
    0
    Like I said ,you didn't got what i have wrote above
    first: there is a difference in time zone here in my country than yours
    second : the post you have got in 5 m i have got it since about 1 month , and any post you can get next time I also got it before you
    I dont came here for wait you to googling
    third : I only need it in MikroC , I dont know how to port from other compilers to MikroC
    .
    if you read my first post you can see I manage to operate Nokia 1100 LCD with Pic16F84a , I just need font sizes and doing graphics
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    With a Pic16F84a? Just 1K instructions? That just doesn't have the power to hold enough data, so switch over to something larger ASAP.

    I did some B&W display work a few years back. I will check tonight if I have any of the files on my current PC. I did fonts in two sizes, and just numbers in a much larger format. The files are essentially bitmaps so there is a routine that takes the screen X-Y, a font pointer, and the letter code and spits out the bitmap where it need be.

    Back then I used a PIC18F4550 but today there are larger memory devices to choose from.

    If I can find those files I will post.
     
  8. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,884
    1,005

    It is not that difficult to port over. C is pretty much C except for a few differences. If you can't figure that out then you are going to have to have a very difficult time finishing your project. You have a very unique combination of requirements. There are 1000s of micros out there. Chances of someone having exactly wht you want is very slim.

    As far as font size I doubt the display will change them for you. You will need to make your own or modify the font with code. You can use something like this to create new fonts
    http://www.mikroe.com/glcd-font-creator/

    Here is some code that shows how to draw a circle and change font size by code
    http://www.modelhobbyprojects.com/nokia-1100-lcd-driver/

    Article is not in English but the code is commented in English.

    You are just going to have to figure this out with the information that you have. It is not that difficult if you alreay have the display working. But you might not have enough memory on that chip to do it.
     
    JohnInTX likes this.
  9. MikroPIC

    Thread Starter New Member

    Jan 19, 2015
    23
    0
    Hi ErnieM , that's very kind of you to reply , you alright 16F84a , really has a minimum capabilities , I will use 16F677 ,because those two is in my hand, and I hope you will find something
    .
    spinnaker , you can't imagine how many pages I had translate ,Russ , Indian , Spanish , chiness , just to get even a small information about that topic , so being these pages isn't in english would make no problem .
     
  10. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,884
    1,005
    The 16F677 is only 128 bytes RAM. Assuming you want to use all ASCII charters that is about 736 bytes just for the font. Assuming you want to use all characters and an 8 bit font.
     
    Last edited: Jan 19, 2015
  11. MikroPIC

    Thread Starter New Member

    Jan 19, 2015
    23
    0
    Man , it's not that hard , if I could make that stuff works , then choosing another chip isn't an issue
     
  12. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    Font data is properly stored in program data as a constant (const) array. You need but a few bytes to chop it into the display.

    The display routine gets a little involved as you read & write the display RAM in byte quantities, but they are rairly if ever on the font boundaries. So you have to read what is there and shift the font data to put it where it needs be.

    I worked that out once (hope I DO find those old programs) so it should be simple. The code is in C but for the C18 compiler. Changing it over to MikroC should not be too trying I hope.
     
  13. MikroPIC

    Thread Starter New Member

    Jan 19, 2015
    23
    0
    I am not so good dealing with LCDs and especially with GLCDs , so I will be wait for what you had make .
     
  14. JohnInTX

    Moderator

    Jun 26, 2012
    2,345
    1,028
    Agreed! Be sure to declare the arrays as const code so that MikroC puts it in ROM. Otherwise, it will build the array in RAM during startup.

    I made a quickie test to see how MikroC built and initialized two arrays (one char, the other const char code) to see what the compiled code looked like. Remarkably, the example code compiles to pretty much the same ROM/RAM size on each of the 16F84A, 16F677 and 18F4520.

    The upshot is that the amount of ROM will be important to hold the big tables and the program of course. Note that the 18F will win the big tables battle since it can store 2 bytes of data per 16bit instruction word. the 16F can only store one byte per 14bit instruction word because it requires using a RETLW dd instruction.

    FWIW here's the code snippet to play with:
    Code (Text):
    1.  
    2. const char code txtROM[] = "0123456789"; // stored in and fetched from ROM
    3. char txtRAM[] = "ABCDEFGHIJ"; // stored in and fetched from RAM
    4.  
    5. char i,j;
    6.  
    7. char cROM,cRAM;
    8. void main(void)
    9. {
    10.   while(1){
    11.    for(i=0,j=0; i<10; i++,j++){
    12.      cROM = txtROM[i];
    13.      PORTB = cROM;
    14.      cRAM = txtRAM[j];
    15.      PORTB = cRAM;
    16.    }//for
    17.   } //while
    18. }
     
  15. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,884
    1,005
    The Nokia 1100 LCD has fonts embedded? Not from anything I have read but I have not actually used one. Everything I have see, you need to draw the characters on your own. I think you code will only serf to confuse the OP. But good point on declaring const or ROM (and to Ernie too). I should have thought of that. But either way both of those chips the OP has are pretty slim on memory if op indeed needs to supply fonts. I suppose you could limit the fonts to just the characters needed but that is not going to make for very flexible code.
     
  16. JohnInTX

    Moderator

    Jun 26, 2012
    2,345
    1,028
    I'll second that! I was trying to make the point that some care be taken in setting up the font arrays (or any other large data tables for that matter) and see how the compiler handles them before committing to a chip.

    For the OP, the first thing I'd do is create font the arrays in C then compile them. Even if you find that the chips you have on hand can't cut it, you can just get a bigger chip and rebuild.

    Have fun.

    Aside: Enhanced mid-range might be a good choice for big tables. It has byte-oriented arrays like the 18F and MikroC uses the FSR's ability to directly access ROM (rather than RETLW or TBLRD operations). The sample code compiles smaller than any of the others.
     
    Last edited: Jan 19, 2015
  17. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,884
    1,005

    I am not certain but the OP is already writing characters to the display and now wants to change font sizes, draw circles etc. If the code in the link I posted above will work then it should be all the OP needs.
     
  18. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    Well... you asked for it. This code comes from a project using a PIC18F87J50 and the C18 compiler.

    I am not sure if this code would work on it's own. I was hoping to give just enough to give you the idea how to go about this as I've lost the documentation I was writing.The intended display was the 128x64 B&W display Mikro sells (sold?) that has a 8 bit parallel interface. So right there at minimum you will need to change the lowest level routines for writing to the display.

    I stopped all work once I saw how cool and simple color displays were, and Microchip had a better library than I was writing.
     
  19. MikroPIC

    Thread Starter New Member

    Jan 19, 2015
    23
    0
    Ok , i will give it a try then inform you , I am not sure if it's MikroC compatible .
     
  20. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    I am sure. It is not MikroC compatible, if only because it calls to Microchip library items you can only find in their archives (that I did not include).

    I present it as examples of font files, and how to use them. Fonts get used in the Glcd_Put_Rom_String(), Glcd_Spot_Rom_String(), Glcd_Put_Ram_String(), and Glcd_Spot_Ram_String() routines (C18 handles RAM and ROM strings differently).

    These all call the routines Glcd_WriteBits() which is the tricky part where fonts get inserted.
     
Loading...