avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] avr-gcc - global variables


From: Mikael Krus
Subject: Re: [avr-gcc-list] avr-gcc - global variables
Date: Wed, 29 Sep 2004 08:04:45 +0200
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)



-------- Original Message --------
Subject:        Re: [avr-gcc-list] avr-gcc - global variables
Date:   Wed, 29 Sep 2004 08:00:10 +0200
From:   Mikael Krus <address@hidden>
To:     Stein Haaland <address@hidden>
References:     <address@hidden>



Your character matrix is very large. Isn't it in fact larger than the available amount of SRAM in AT90S8515????

/Mikael Krus

Stein Haaland wrote:

I am trying to write a number of bytes into EEPROM
(actually a set of characters for a 5x7 dot matrix),
and need some help with global variables :


a) What is wrong with the following code :

//
// character = global variable
//
volatile uint8_t character[90][7] =
{
{ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F },
{ 0x13, 0x13, 0x13, 0x13, 0x13, 0x1F, 0x13 },
{ 0x15, 0x15, 0x15, 0x1F, 0x1F, 0x1F, 0x1F },
{ ... }
};


void fill_eeprom()
{
 uint8_t val;
 uint16_t i,j,addr;
for (i=0; i<90; i++) { for (j=0; j<7; j++) { addr = 7*i+j; val = character[i][j];
      eeprom_wb(addr,val);
      PORTC = ~val;
wait(400); PORTC = ~0x00; wait(400); } }
}

void main(void)
{ ....
}


Port C switches between 0xFF (= ~0x00) and 0x00 - no sign
of my character table.


b) Is there a better way to do this than the above approach ?


Sys :
MDK Linux 10.0.
avr-gcc (GCC) 3.3.2 objcopy 2.14 20030612
uisp version 20040311
STK500 testboard, AT90S8515

------
SEH.

_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list





reply via email to

[Prev in Thread] Current Thread [Next in Thread]