Nokia 6100 Library

Status
Not open for further replies.
Also how come no one told me about this feature:



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.
 

Attachments

  • vdd.jpg
    51.5 KB · Views: 765
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
 
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
 
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
 
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:

**broken link removed**
 
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.
 
wow how simple sprintf is and i never knew heh...

Code:
    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!

 

Attachments

  • cont.jpg
    238.8 KB · Views: 841
Last edited:
Code:
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:
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 .
 
Wow, you didn't know about sprintf? It's like a swiss army knife of string formatting.

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.
 
here is the code kinda cleaned up with a small sample data.
 

Attachments

  • Nokia6100_Only.zip
    32.6 KB · Views: 259
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…