Nokia lcd include , small footprint to suit pic16's


Closed Thread
Results 1 to 40 of 111

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    mike

    mssp is pretty easy


    SSP1CON1=0x21 ;$22,21,20 all work @32mhz 20 is fastest
    SSP1STAT=0x40
    sdo and sck pins set to dig o/p


    to transfer data
    PIR1.3=0
    SSP1BUF = data
    WHILE (!PIR1.3) ;

    tried your code on 16f1847 ,its not working
    Warning I'm not a teacher

  2. #2
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    It seems XC8 is placing my program code on top of my font table in the 0700h area of memory. More detective work (sigh)...

    Thanks for the MSSP/SPI info, Richard. I will get to that after tracking down the current problem...

    Mike

    <added>

    If you get a chance, add the "ovrld" param' to the following line and tell me if that fixes the problem, please?

    Code:
       PSECT myFonts, class=CODE, abs, ovrld, space=0, delta=2
                                       ^^^^^
    Last edited by Mike, K8LH; - 26th May 2018 at 14:55.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    ovrld,

    does not fix it
    even local too

    there is more wrong than just that , the putwreg function is getting called six times for the wrchar
    and only 5 times for the entire putstr call
    its a total bitch to debug with all that inline asm , the debugger just
    goes stupid

    putcmd looks fine on the logic analyser , it all goes pear shaped from then on
    Warning I'm not a teacher

  4. #4
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Sorry, Richard (and gang). A bug at the very top of the putchar() routine was messing up the font table address. And yes, I know assembler is a PITA... I wish I could get a gratis copy of PBP...

    Corrected version attached (375 words total). I still need to dig out my old Nokia 5110 display and test this on real hardware. I also have a tiny 128x32 I2C OLED display and a tiny 128x64 SPI OLED display to play with sometime soon.

    Cheerful regards, Mike

    Nokia_Main.c.txt

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    putstr still not working

    I think it should look like this, but it only works for the first call
    so I get "Re and then garbage

    Code:
     void putstr(const char *str)     // put 'ROM' strings
       {                     //
         while(*str) 
           wrchar(*str++);
       }                                //
    Warning I'm not a teacher

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    more oddly

    strcpy(buff,"eady");


    putstr(buff);

    works with my modified routine


    putstr("eady");
    crashes the show
    Warning I'm not a teacher

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Code:
    void wrchar(char d)          //
       { 
         volatile char ascii=d;
    fixed it, compiler optimised ascii var out
    Warning I'm not a teacher

  8. #8
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Yes, your putstr() routine is better...

    While debugging I've found XC8 is using the same memory location for local variables in both the wrchar() and putstr() functions. The wrchar@ascii variable is using 70h and the putstr@str pointer is using 70h and 71h. Is this a result of my heavy use of assembly code? That is, XC8 doesn't realize those local variables need to be unique? How do I get XC8 to use unique memory locations for those local variables?

  9. #9
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    make them static
    Warning I'm not a teacher

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. 16F946 pcb footprint (64 tqfp)
    By nomad in forum Schematics
    Replies: 2
    Last Post: - 8th September 2009, 11:14
  3. small 2X16 LCD
    By Ron Marcus in forum Off Topic
    Replies: 2
    Last Post: - 26th October 2007, 20:37
  4. Nokia 3310 LCD
    By barkerben in forum General
    Replies: 3
    Last Post: - 10th December 2005, 19:08
  5. Small LCD module,character
    By Ron Marcus in forum Off Topic
    Replies: 6
    Last Post: - 27th November 2005, 18:13

Members who have read this thread : 3

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts