Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 5th July 2009, 10:44 PM   #166
Default

darn ok cool thanks!

I guess eeprom or editing the linker is the only way to gain ram(SPACE)
AtomSoft is offline  
Old 5th July 2009, 11:04 PM   #167
Default

Can someone help me create a 800 byte buffer lol its for a 18F2525

This is my usage so far:
Attached Thumbnails
Graphic LCD 96x64 w/ SED1565 Controller-usage.jpg  

Last edited by AtomSoft; 5th July 2009 at 11:05 PM.
AtomSoft is offline  
Old 5th July 2009, 11:07 PM   #168
Default

You can reflash pages within your program, same way you do with a boot loader or serial programmer, but that's really meant for permanent storing variables that you don't want lost in a power down.

If you want RAM, you can use SRAM rather than EEPROM, which is faster, but obviously you lose everything on power down.
__________________
Mark Higgins
DirtyLude is online now  
Old 5th July 2009, 11:09 PM   #169
Default

You just want a FIFO buffer? If you search 'ring buffer' and 'C library' and combinations, there's lots of example code for it out there.
__________________
Mark Higgins
DirtyLude is online now  
Old 5th July 2009, 11:10 PM   #170
Default

oh man i even forgot about the option for external ram lol thanks!

Any thoughts of internal (software) type fixes for now?
AtomSoft is offline  
Old 5th July 2009, 11:11 PM   #171
Default

I need it to store the entire screen. Like this dude did but on a ARM7. Its a pain in the butt for C18
AtomSoft is offline  
Old 5th July 2009, 11:22 PM   #172
Default

If you are getting the error
Error [1300] stack frame too large

A simple way to fix it is to make the variable global.
If you put it inside main or any other function it will allocate memory from the stack. If you make it global it does not.

Give it a try.

3v0
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
3v0 is offline  
Old 5th July 2009, 11:36 PM   #173
Default

im getting this:
Code:
MPLINK 4.31, Linker
Copyright (c) 2009 Microchip Technology Inc.
Error - section '.udata_nokia7110.o' can not fit the section. Section '.udata_nokia7110.o' length=0x00000304
Errors    : 1
Im trying to create:
Code:
unsigned char ScreenBuff[770];
AtomSoft is offline  
Old 5th July 2009, 11:37 PM   #174
Default

You could make up a scheme to code everything. It's complex, but since there's mostly blank columns your buffer could be encoded sort of like RLE (run length encoding), but modified. I can envision what it would take, but it would be complicated to maintain. Your buffer would be dynamic and data would need to be moved around a lot. It would also mean that you couldn't have too much data on the screen or your buffer would have the potential to grow larger than a straight dedicated buffer.
__________________
Mark Higgins
DirtyLude is online now  
Old 5th July 2009, 11:40 PM   #175
Default

The only fix i know of is :
Code:
#pragma idata bigdata
    unsigned char ScreenBuff[770];
#pragma idata
Linker Modification :
Code:
DATABANK   NAME=gpr10      START=0xA00          END=0xDFF	//END=0xAFF
//DATABANK   NAME=gpr11      START=0xB00          END=0xBFF
//DATABANK   NAME=gpr12      START=0xC00          END=0xCFF
//DATABANK   NAME=gpr13      START=0xD00          END=0xDFF
....
.....
.......
SECTION    NAME=bigdata    RAM=gpr10

Last edited by AtomSoft; 5th July 2009 at 11:41 PM.
AtomSoft is offline  
Old 6th July 2009, 01:01 AM   #176
Default

Thanks guys here are some of the functions i have working.

Code:
void LCDCircle(char top, char left, char radius);
void SetPixel(unsigned char top, unsigned char left);
void LCDRect(char x0, char y0, char width, char height);
void LCDImage(rom unsigned char *image,char left, char top);
void LCDLine(char top0, char left0, char top1, char left1);
void LCDChar(unsigned char letter,unsigned char font,unsigned char style,unsigned char top, unsigned char left);
void LCDString(rom unsigned char *str,unsigned char font,unsigned char style,unsigned char top, unsigned char left);
All working 100% so far. Will release in a week or so
AtomSoft is offline  
Old 6th July 2009, 01:33 AM   #177
Default

heh look :


Main Code:
Code:
#include <p18f2525.h>
#include "nokia7110.h"

#pragma config WDT = OFF, LVP = OFF, OSC = INTIO67, XINST = OFF

unsigned rom char foot[770] = { 96,64,
 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  128,  128,  128,  192,  192,  128,  128,  128,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 0,  0,  0,  0,  0,  0,  0,  0,  192,  224,  240,  240,  248,  248,  252,  252,  252,  252,  252,  248,  248,  240,  240,  224,  192,  128,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  128,  224,  240,  248,  252,  254,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  252,  0,  0,  56,  124,  124,  252,  252,  252,  252,  252,  248,  248,  112,  0,  0,  0,  0,  0,  0,  0, 
 0,  0,  0,  0,  0,  0,  0,  31,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  254,  254,  252,  248,  248,  240,  240,  224,  224,  192,  192,  192,  128,  128,  128,  128,  128,  128,  128,  128,  128,  192,  192,  224,  224,  240,  240,  248,  252,  254,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  127,  31,  7,  3,  0,  0,  48,  112,  248,  248,  248,  240,  240,  97,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  3,  3,  7,  7,  15,  15,  15,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  63,  63,  63,  63,  127,  127,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  255,  127,  15,  0,  128,  128,  196,  142,  158,  158,  30,  62,  30,  28,  8,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  3,  3,  3,  7,  7,  7,  15,  15,  31,  31,  31,  63,  63,  63,  127,  127,  127,  127,  127,  127,  127,  127,  63,  63,  31,  31,  15,  3,  49,  112,  240,  240,  243,  227,  71,  7,  7,  7,  3,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
};
void main(void);

void main(void){
    char a,b,c,d;

	OSCCON = 0x72;      			//8MHz clock
	while(!OSCCONbits.IOFS);		//wait for osc stable

	LCD_Init();
    ClearBuff();

	while(1){
	    CLS();
        LCDString((unsigned rom char*)"AtomSoftTech    ",0,None,0,0);
        LCDString((unsigned rom char*)"   .info        ",0,None,1,0);
        LCDString((unsigned rom char*)" Nokia 7110 LCD ",0,None,3,0);
        LCDString((unsigned rom char*)"Author:",1,Underline,5,0);
        LCDString((unsigned rom char*)"Jason Lopez     ",0,None,7,0);
        while(bitchk(LCD_PORT,BTN));
        Delay10KTCYx(10);

	    CLS();
	    LCDImage(foot,0,0);
        while(bitchk(LCD_PORT,BTN));
        Delay10KTCYx(10);

	    CLS();
        for(d=0;d<8;d++){
            b=0;
            for(a=0;a<96;a++){
                SetPixel(b+(d*8),a);
                b++;
                if(b==8)b=0;
            }
        }
        SendBuff();
        ClearBuff();
        while(bitchk(LCD_PORT,BTN));
        Delay10KTCYx(10);

	    CLS();
        LCDLine(5,10,5,80);
        SendBuff();
        ClearBuff();
        while(bitchk(LCD_PORT,BTN));
        Delay10KTCYx(10);

	    CLS();
        LCDCircle(20,20,10);
        LCDCircle(30,30,10);
        LCDCircle(36,36,10);
        SendBuff();
        ClearBuff();
        while(bitchk(LCD_PORT,BTN));
        Delay10KTCYx(10);

	    CLS();
        LCDRect(20,20,40,20);
        SendBuff();
        ClearBuff();
        while(bitchk(LCD_PORT,BTN));
        Delay10KTCYx(10);

    }
}

Last edited by AtomSoft; 6th July 2009 at 01:37 AM.
AtomSoft is offline  
Old 6th July 2009, 11:42 AM   #178
Default

Hey guys! look at what i just won on ebay:

Olimex LPC-P2148 Prototype Board LPC2148 ARM NXP USB/SD - eBay (item 250454529025 end time Jul-05-09 15:15:34 PDT)

$24 !!!!! omg i just payed now lol i saved about $53 ($77 at sparkfun) shipping was about same price as sparkfun too!

SparkFun Electronics - Prototyping Board for LPC2148
AtomSoft is offline  
Old 6th July 2009, 03:29 PM   #179
Default

New cube function:
Code:
void LCDCube(char Sq0T,char Sq0L,char Sq1T,char Sq1L,char width, char height) {
unsigned char x,y;
unsigned char a,b;

        x = Sq0L + width;
        y = Sq1L + width;
        a = Sq0T + height;
        b = Sq1T + height;

        LCDRect(Sq0T,Sq0L,width,height);
        LCDRect(Sq1T,Sq1L,width,height);
        LCDLine(Sq0T,Sq0L,Sq1T,Sq1L);
        LCDLine(Sq0T,x,Sq1T,y);
        LCDLine(a,Sq0L,b,Sq1L);
        LCDLine(a,x,b,y);
}
Testing:

Last edited by AtomSoft; 6th July 2009 at 03:49 PM.
AtomSoft is offline  
Old 6th July 2009, 04:20 PM   #180
Default

Is hidden line removal next ???

Just kidding. Great job, I am looking forward to using your code.

3v0
__________________
Please post questions to the forums. PM's are for personal communication.

BCHS/3v0's Tutorials
Junebug USB PIC programmer kit., USB Bit Whacker,
The 15 Minute Printed Circuit Board! (+drill time)
3v0 is offline  
Reply

Tags
96x64, controller, graphic, lcd, nokia7110, sed1565, w or

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Graphic LCD baberjaved Micro Controllers 2 13th November 2007 05:01 PM
Graphic LCD flemmard Micro Controllers 1 13th September 2007 03:32 AM
interfacing of PIC16F877A with graphic LCD controller T6963c rosamma Micro Controllers 1 24th March 2007 12:29 PM
graphic LCD PIC MCU tom_electronic Micro Controllers 4 28th February 2006 12:29 PM
graphic lcd help jijita General Electronics Chat 1 18th August 2004 07:32 AM



All times are GMT. The time now is 03:26 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker