CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Library for using nokia 5110 lcd ?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
qwwe



Joined: 17 Sep 2017
Posts: 59

View user's profile Send private message

PostPosted: Mon Dec 25, 2017 2:19 pm     Reply with quote

I wrote two different programs for each one:
This app is for testing the following function
Code:

nokia_bitmap(rom *bitmap,bx,by,xdim,ydim,color,align) 


Code:

#include <16f1829.h>
#device *=16
#fuses HS             //High speed Osc (> 4mhz for PCM/PCH)
#fuses NOWDT            //NO Watch Dog Timer
#fuses PUT            //Power Up Timer
#fuses NOLVP          //No low voltage programing
#fuses NOCPD          //No EE protection
#fuses NOPROTECT      //Code not protected from reading
#fuses NOWRT          //Program memory not write protected
#fuses NODEBUG        //No Debug mode for ICD
#fuses NOBROWNOUT     //No brownout reset
#USE DELAY (crystal=11059200)
//#USE RS232(ENABLE=PIN_A2,BAUD=9600,XMIT=PIN_C4,RCV=PIN_C5,PARITY=N,BITS=8,STOP=1,ERRORS)
#include <stdio.h>
#include <string.h>
#include <Nokia_5110.c>

const char c[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
....};
void main()
{

nokia_init();

nokia_bitmap(c,1,1,48,50,1,0);
nokia_refresh();
while(TRUE)
{
}
}


and
This app is for testing the following function
Code:

nokia_bigc(c)



Code:

#include <16f1829.h>
#device *=16
#fuses HS             //High speed Osc (> 4mhz for PCM/PCH)
#fuses NOWDT            //NO Watch Dog Timer
#fuses PUT            //Power Up Timer
#fuses NOLVP          //No low voltage programing
#fuses NOCPD          //No EE protection
#fuses NOPROTECT      //Code not protected from reading
#fuses NOWRT          //Program memory not write protected
#fuses NODEBUG        //No Debug mode for ICD
#fuses NOBROWNOUT     //No brownout reset
#USE DELAY (crystal=11059200)
//#USE RS232(ENABLE=PIN_A2,BAUD=9600,XMIT=PIN_C4,RCV=PIN_C5,PARITY=N,BITS=8,STOP=1,ERRORS)
#include <stdio.h>
#include <string.h>
#include <Nokia_5110.c>
int c=10;
void main()
{

nokia_init();
nokia_gotoxy(1,1);
nokia_bigc(c);
nokia_refresh();
while(TRUE)
{
}
}

PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 25, 2017 3:02 pm     Reply with quote

You are giving nokia_bigc() an input value that is not in the expected range.
Quote:
int c=10;
void main()
{

nokia_init();
nokia_gotoxy(1,1);
nokia_bigc(c);
nokia_refresh();
while(TRUE)
{
}
}

The nokia_bigc() function has this note:
Code:
// Displays 10x12 pixels numerical characters (-. 0123456789)

So try this instead:
Code:
int c = '9';

Then you should see something. Note that nokia_bigc() expects ASCII
numbers, or the ASCII minus sign and period.

-------------------------------
Re: nokia_bitmap() function:

The resolution of the Nokia display is only 84 x 48 (x, y).
But in the code below, you have 50 for the Y dimension. This is too large.
Quote:
void main()
{

nokia_init();

nokia_bitmap(c,1,1,48,50,1,0);
nokia_refresh();
while(TRUE)
{
}
}

Try it with smaller numbers than 48, 50. Try it with 10, 10.
qwwe



Joined: 17 Sep 2017
Posts: 59

View user's profile Send private message

PostPosted: Tue Dec 26, 2017 12:12 am     Reply with quote

Thanks to the problem solved with the following function.
Code:

nokia_bigc();

But the problem with the following function is still ongoing:
Code:

nokia_bitmap(rom *bitmap,bx,by,xdim,ydim,color,align);

Of course, when I determined the number of members of the array I defined, the image on the page was determined, along with the many errors that Proteus provided, all of which were as follows. And I did not get picture what I wanted:


[PIC16 EEPROM] PC=0x025B. Address for read/write of program memory (0x202B) is outside of the memory (8192 words) - address has been wrapped. [U1]
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Dec 26, 2017 6:17 am     Reply with quote

I had a look at the driver, again, and it only does very basic testing for valid x,y numbers. As the programmer, it is your job to ensure values for x,y, etc. are valid and within the range of the device. The same holds true for storing of images or other data into the PIC memory.
While there are 'tricks' to storing lots of data into small memory, these days you just buy a 'bigger' PIC.
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Tue Dec 26, 2017 6:53 am     Reply with quote

Also (sneaking suspicion), he may be trying to store an image that is too large for the ROM on this PIC.
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Dec 26, 2017 7:34 am     Reply with quote

but.. I've seen 20 clowns come out of a small car at the circus !
You're probably right though; BIG image, small EEPROM.
When you have limited 'resources' you need to think 'outside the box' and design code accordingly. These days it typically takes 6 bytes to store a time variable, when 30 years ago I did it in 1 byte and had a bit leftover. For my application, remote energy control [setback on/off times], it's worked exceedingly well, still does today.
qwwe



Joined: 17 Sep 2017
Posts: 59

View user's profile Send private message

PostPosted: Tue Dec 26, 2017 11:32 pm     Reply with quote

Mr. PCM programmer Do not you know what the problem is?
Thanks for help.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 27, 2017 1:08 am     Reply with quote

Post a new test program that has a much smaller bitmap. Post the
complete const array data. Don't use "...". Also, don't use data that
is all 0x00, 0x00, 0x00, etc.

Post what you expect to see on the Nokia LCD, and also post what you
actually see. For example:
"I expect to see a solid square that is 5 x 5 pixels in the upper left corner
of the screen". "But I actually see nothing. The screen is blank".
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group