1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Nokia 6100 Library

Discussion in 'Microcontrollers' started by AtomSoft, Oct 27, 2009.

  1. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Also how come no one told me about this feature:

    [​IMG]

    i just fried 2 MicroSD cards heh a 2GB and 1GB

    Using that can i safely set the max VDD to 3.3v? I had a couple issues where my power supply was unplugged and PICKIT supplied 5v heh and found out TRACK 0 is dead.
     

    Attached Files:

    • vdd.jpg
      vdd.jpg
      File size:
      51.5 KB
      Views:
      591
  2. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    It does set the voltage.

    As I recall the problem is that it does not stay set. I think you have to reset it after you connect each time. Not sure at all. Could have MPLAB and PICkit2 software confused...

    Rather then mess with it I provide a 3.3V supply to the target.

    3v0
     
  3. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    I supply 3.3v also but as noted before sometimes my power gets discnnected and pickit powers it heh. So I'm looking forward to this actualy working
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA

    I expect you will be disappointed.

    Luckly my 3.3V stuff was able to stand 5V for a while.
    If you want real protection add a zener.

    3v0
     
  6. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    I know this is a dumb question but .... how do i add a zenor. Im sure i have a few ...
     
  7. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    this is slightly of topic but is related to strings and can be useful for lcd's....

    im sure people remember me asking about sprintf around here well i finally found some very great info in the crossworks documentation:

    sprintf
     
  8. DirtyLude

    DirtyLude Well-Known Member

    Joined:
    Aug 5, 2003
    Messages:
    1,904
    Likes:
    56
    Location:
    Toronto, Canada
    You can get a detailed description of sprintf all over the place. This was the first hit I got when I googled.

    sprintf - C++ Reference

    It has exactly the same string parameters as printf, but it outputs to a string rather than a data stream. Both printf and sprintf aren't all that popular on 8bits because they can suck up a lot of space. Newer compilers can cut up the functionality provided by printf/sprintf and only include what is needed now though, so if you are just doing a simple itoa it might not be that bad.
     
  9. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    It's funny because I could never find info on it thanks
     
  10. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    wow how simple sprintf is and i never knew heh...

    Code (text):

        Contrast = 57;
        LCDFill(WHITE);
         
        sprintf(tempStr, "Contrast: %d",Contrast);
        LCDPutStr(tempStr,10,10,0,BLACK,WHITE);
     
    I wish i knew about this sooner heh. i would have been using it to convert numbers to ASCII.

    works like a charm!

    [​IMG]
     

    Attached Files:

    • cont.jpg
      cont.jpg
      File size:
      238.8 KB
      Views:
      617
    Last edited: Nov 19, 2009
  11. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Code (text):

    void main(void){
                   
        ADCON1 = 0x0F;
        LCDInit();

        contrast = 57;
        LCDCommand(SETCON);
        LCDData(contrast);

        LCDFill(WHITE);

        sprintf(tempStr, "Company: %s",company);
        LCDPutStr(tempStr,10,10,0,BLACK,WHITE);      

        sprintf(tempStr, "Contrast: %d",contrast);
        LCDPutStr(tempStr,20,10,0,BLACK,WHITE);
        while(1){
        }
    }
     
    hey guys i noticed this:
    but i know it works but i dont just want to clear the warnings by not showing them. whats the real problem? how do i fix this? i tried placing a &, * heh but no luck
     
    Last edited: Nov 19, 2009
  12. DirtyLude

    DirtyLude Well-Known Member

    Joined:
    Aug 5, 2003
    Messages:
    1,904
    Likes:
    56
    Location:
    Toronto, Canada
    We need to see your definitions for tempStr and contrast.
     
  13. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    heh sorry bout that:
    Code (text):

    unsigned char tempStr[16];  
    unsigned char company[9]={"AtomSoft"};
     
     
  14. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Wow, you didn't know about sprintf? It's like a swiss army knife of string formatting.
     
  15. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Heh nice one! I knew about it but now how it worked. It's a pretty useful tool and I got it to work nice with floats. I will mostly use it to merge number and text in a string since it adds the 0x00 to the end .
     
  16. DirtyLude

    DirtyLude Well-Known Member

    Joined:
    Aug 5, 2003
    Messages:
    1,904
    Likes:
    56
    Location:
    Toronto, Canada
    I think that's from learning C on Microcontrollers. Back in the day when we used K&R C for PC's, it was part of the fundamentals of C programming.

    How much space is sprintf taking up on compile time? Is your compiler able to only link in printf functionality it's using, or are you getting the whole thing? It's not important, I was just interested.

    Try changing your variable assignments to char rather than unsigned char to remove the type mismatch warnings.
     
  17. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
  18. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    here is the code kinda cleaned up with a small sample data.
     

    Attached Files:

  19. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
  20. birdman0_o

    birdman0_o Active Member

    Joined:
    Feb 23, 2009
    Messages:
    1,370
    Likes:
    18
    Location:
    Montreal, Quebec
    Great work, can it do my homework yet?
     
  21. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    heh thanks.... i wish!
     

Share This Page