Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

strange display

strange display

2006-11-06 by Moataz Hussein

I am testing a simple countdown timer 99 to 0 which is
displayed on 2 seven segment displays connected to the
Atmega 8. number conversion is by a lookup table
stored in registers 0 -9 in the init section.
am using Atmega 8L, internal RC.


The problem is that sometimes it starts with strange
combinations on the display (you feel that the error
is in the conversion) and continues chaging display at
correct times. other times it works fine.

I tried reset when it get the error but it resets
itself to the initial wrong display.

what can I do?? any suggestions?

Moataz




 
____________________________________________________________________________________
We have the perfect Group for you. Check out the handy changes to Yahoo! Groups 
(http://groups.yahoo.com)

Re: [AVR-Chat] strange display

2006-11-06 by David VanHorn

Verify that when you load Z, it's actually pointing to twice the address of
the table base, plus the proper offset?

Verify that you are picking up the data after the LPM instruction and not
erasing it accidentally.

Check that you don't have an ISR that is killing the data.


[Non-text portions of this message have been removed]

Re: [AVR-Chat] strange display

2006-11-06 by np np

Could be in your initialisation.
   
   
  

Moataz Hussein <husseinmoataz@yahoo.com> wrote:
          

I am testing a simple countdown timer 99 to 0 which is
displayed on 2 seven segment displays connected to the
Atmega 8. number conversion is by a lookup table
stored in registers 0 -9 in the init section.
am using Atmega 8L, internal RC.

The problem is that sometimes it starts with strange
combinations on the display (you feel that the error
is in the conversion) and continues chaging display at
correct times. other times it works fine.

I tried reset when it get the error but it resets
itself to the initial wrong display.

what can I do?? any suggestions?

Moataz

__________________________________________________________
We have the perfect Group for you. Check out the handy changes to Yahoo! Groups 
(http://groups.yahoo.com)



         

 Send instant messages to your online friends http://uk.messenger.yahoo.com 

[Non-text portions of this message have been removed]

Re: [AVR-Chat] strange display

2006-11-06 by Dennis Clark

I suggest that you check for an uninitialized variable.  A reset will 
leave you in a bad state, a power cycle may not.

DLC

np np wrote:
> Could be in your initialisation.
>    
>    
>   
> 
> Moataz Hussein <husseinmoataz@yahoo.com> wrote:
>           
> 
> I am testing a simple countdown timer 99 to 0 which is
> displayed on 2 seven segment displays connected to the
> Atmega 8. number conversion is by a lookup table
> stored in registers 0 -9 in the init section.
> am using Atmega 8L, internal RC.
> 
> The problem is that sometimes it starts with strange
> combinations on the display (you feel that the error
> is in the conversion) and continues chaging display at
> correct times. other times it works fine.
> 
> I tried reset when it get the error but it resets
> itself to the initial wrong display.
> 
> what can I do?? any suggestions?
> 
> Moataz
> 
> __________________________________________________________
> We have the perfect Group for you. Check out the handy changes to Yahoo! Groups 
> (http://groups.yahoo.com)
> 
> 
> 
>          
> 
>  Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
> 

-- 
---------------------------------------
Dennis Clark    TTT Enterprises
---------------------------------------

Re: [AVR-Chat] strange display

2006-11-07 by Moataz Hussein

Thanks for the suggestions,

I mentioned that sometims it is working fine; starting
at 99 and counting down at 1 sec intervals, updating
display correctly. This indicates that initialization
is ok, lookup table, addressing is ok!

BUT SOMETIMES it gets this strange output on the seven
segment which is changing at 1 sec intervals. this
strange output is repeated every 10 sec, which appears
that the problem is in the reading data from lookup
table.

If it starts giving correct output it continues this
way, also if it starts giving strange output it
continues.

My question is:
1- Why is it sometimes working ok and stable and
sometimes not? if it is getting correct output code
why sometimes it is corrupted?

2- If a reset is done at the reset pin will it do a
complete reset? because what happens is that when it
gives strange output a reset brings it back to the
first corrupted displyed output not the 99 as it
should be.

I tried different chip and the same happened.

Moataz




--- David VanHorn <microbrix@gmail.com> wrote:

> Verify that when you load Z, it's actually pointing
> to twice the address of
> the table base, plus the proper offset?
> 
> Verify that you are picking up the data after the
> LPM instruction and not
> erasing it accidentally.
> 
> Check that you don't have an ISR that is killing the
> data.
> 
> 
> [Non-text portions of this message have been
> removed]
> 
> 




 
____________________________________________________________________________________
Sponsored Link

Degrees online in as fast as 1 Yr - MBA, Bachelor's, Master's, Associate
Click now to apply http://yahoo.degrees.info

Re: strange display

2006-11-07 by gregorslemi

I believe the problem is, that when you separate the digits in the
variable, the variable is not 9 but it is 19 or something simmilar, so
it looks for number outside the lookup table.

Slemi

--- In AVR-Chat@yahoogroups.com, Moataz Hussein <husseinmoataz@...> wrote:
>
> 
> Thanks for the suggestions,
> 
> I mentioned that sometims it is working fine; starting
> at 99 and counting down at 1 sec intervals, updating
> display correctly. This indicates that initialization
> is ok, lookup table, addressing is ok!
> 
> BUT SOMETIMES it gets this strange output on the seven
> segment which is changing at 1 sec intervals. this
> strange output is repeated every 10 sec, which appears
> that the problem is in the reading data from lookup
> table.
> 
> If it starts giving correct output it continues this
> way, also if it starts giving strange output it
> continues.
> 
> My question is:
> 1- Why is it sometimes working ok and stable and
> sometimes not? if it is getting correct output code
> why sometimes it is corrupted?
> 
> 2- If a reset is done at the reset pin will it do a
> complete reset? because what happens is that when it
> gives strange output a reset brings it back to the
> first corrupted displyed output not the 99 as it
> should be.
> 
> I tried different chip and the same happened.
> 
> Moataz
> 
> 
> 
> 
> --- David VanHorn <microbrix@...> wrote:
> 
> > Verify that when you load Z, it's actually pointing
> > to twice the address of
> > the table base, plus the proper offset?
> > 
> > Verify that you are picking up the data after the
> > LPM instruction and not
> > erasing it accidentally.
> > 
> > Check that you don't have an ISR that is killing the
> > data.
> > 
> > 
> > [Non-text portions of this message have been
> > removed]
> > 
> > 
> 
> 
> 
> 
>  
>
____________________________________________________________________________________
Show quoted textHide quoted text
> Sponsored Link
> 
> Degrees online in as fast as 1 Yr - MBA, Bachelor's, Master's, Associate
> Click now to apply http://yahoo.degrees.info
>

Re: [AVR-Chat] strange display

2006-11-07 by Cat C

Do you reload the flash (program) between tries?

I mean: after it goes bad, do you reload it, and then it works good for a 
while?

Or, just power-cycling it makes it sometimes OK, sometimes bad.

Does the program store anything in RAM?

Cat

----Original Message Follows----
Show quoted textHide quoted text
From: Moataz Hussein <husseinmoataz@yahoo.com>
Reply-To: AVR-Chat@yahoogroups.com
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] strange display
Date: Tue, 7 Nov 2006 00:42:24 -0800 (PST)


Thanks for the suggestions,

I mentioned that sometims it is working fine; starting
at 99 and counting down at 1 sec intervals, updating
display correctly. This indicates that initialization
is ok, lookup table, addressing is ok!

BUT SOMETIMES it gets this strange output on the seven
segment which is changing at 1 sec intervals. this
strange output is repeated every 10 sec, which appears
that the problem is in the reading data from lookup
table.

If it starts giving correct output it continues this
way, also if it starts giving strange output it
continues.

My question is:
1- Why is it sometimes working ok and stable and
sometimes not? if it is getting correct output code
why sometimes it is corrupted?

2- If a reset is done at the reset pin will it do a
complete reset? because what happens is that when it
gives strange output a reset brings it back to the
first corrupted displyed output not the 99 as it
should be.

I tried different chip and the same happened.

Moataz




--- David VanHorn <microbrix@gmail.com> wrote:

 > Verify that when you load Z, it's actually pointing
 > to twice the address of
 > the table base, plus the proper offset?
 >
 > Verify that you are picking up the data after the
 > LPM instruction and not
 > erasing it accidentally.
 >
 > Check that you don't have an ISR that is killing the
 > data.
 >
 >
 > [Non-text portions of this message have been
 > removed]
 >
 >





____________________________________________________________________________________
Sponsored Link

Degrees online in as fast as 1 Yr - MBA, Bachelor's, Master's, Associate
Click now to apply http://yahoo.degrees.info



Yahoo! Groups Links



_________________________________________________________________
Find a local pizza place, music store, museum and more�then map the best 
route! Check out Live Local today!  http://local.live.com/?mkt=en-ca/

Re: [AVR-Chat] strange display

2006-11-07 by Moataz Hussein

I do not re program, just power cycling.
nothing in the ram


Moataz



--- Cat C <catalin_cluj@hotmail.com> wrote:

> Do you reload the flash (program) between tries?
> 
> I mean: after it goes bad, do you reload it, and
> then it works good for a 
> while?
> 
> Or, just power-cycling it makes it sometimes OK,
> sometimes bad.
> 
> Does the program store anything in RAM?
> 
> Cat
> 
> ----Original Message Follows----
> From: Moataz Hussein <husseinmoataz@yahoo.com>
> Reply-To: AVR-Chat@yahoogroups.com
> To: AVR-Chat@yahoogroups.com
> Subject: Re: [AVR-Chat] strange display
> Date: Tue, 7 Nov 2006 00:42:24 -0800 (PST)
> 
> 
> Thanks for the suggestions,
> 
> I mentioned that sometims it is working fine;
> starting
> at 99 and counting down at 1 sec intervals, updating
> display correctly. This indicates that
> initialization
> is ok, lookup table, addressing is ok!
> 
> BUT SOMETIMES it gets this strange output on the
> seven
> segment which is changing at 1 sec intervals. this
> strange output is repeated every 10 sec, which
> appears
> that the problem is in the reading data from lookup
> table.
> 
> If it starts giving correct output it continues this
> way, also if it starts giving strange output it
> continues.
> 
> My question is:
> 1- Why is it sometimes working ok and stable and
> sometimes not? if it is getting correct output code
> why sometimes it is corrupted?
> 
> 2- If a reset is done at the reset pin will it do a
> complete reset? because what happens is that when it
> gives strange output a reset brings it back to the
> first corrupted displyed output not the 99 as it
> should be.
> 
> I tried different chip and the same happened.
> 
> Moataz
> 
> 
> 
> 
> --- David VanHorn <microbrix@gmail.com> wrote:
> 
>  > Verify that when you load Z, it's actually
> pointing
>  > to twice the address of
>  > the table base, plus the proper offset?
>  >
>  > Verify that you are picking up the data after the
>  > LPM instruction and not
>  > erasing it accidentally.
>  >
>  > Check that you don't have an ISR that is killing
> the
>  > data.
>  >
>  >
>  > [Non-text portions of this message have been
>  > removed]
>  >
>  >
> 
> 
> 
> 
> 
>
____________________________________________________________________________________
> Sponsored Link
> 
> Degrees online in as fast as 1 Yr - MBA, Bachelor's,
> Master's, Associate
> Click now to apply http://yahoo.degrees.info
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
>
_________________________________________________________________
> Find a local pizza place, music store, museum and
> more…then map the best 
> route! Check out Live Local today! 
> http://local.live.com/?mkt=en-ca/
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 




 
____________________________________________________________________________________
Sponsored Link

Get a free Motorola Razr! Today Only! 
Choose Cingular, Sprint, Verizon, Alltel, or T-Mobile. 
http://www.letstalk.com/inlink.htm?to=592913

Re: [AVR-Chat] strange display

2006-11-07 by David VanHorn

On 11/7/06, Moataz Hussein <husseinmoataz@yahoo.com> wrote:
>
>
> I do not re program, just power cycling.
> nothing in the ram


You're going to have to chase it out, debugging is where it really gets
interesting.

One thing that I do on all my projects, is during init, before I set up
anything that uses ram, I write all ram cells to zero.  This helps assure
that everything starts from a known state.  If I ever forget to init a ram
variable, at least it will start from the same state.

I've also been known to go change that to $FF or other values, hoping to
uncover anything that was actually using an uninitted value.


[Non-text portions of this message have been removed]

Re: [AVR-Chat] strange display

2006-11-07 by Moataz Hussein

Thanks for advice I think this will be the only way
out.

I deleted the conversion part from the program and
used an external BCD to seven segment converter and is
working fine, but still need to know where the problem
is.

One last question, which emulator would you recommend?
Is the Jtag ICE MkII good for that.

Thanks

Moataz


--- David VanHorn <microbrix@gmail.com> wrote:

> On 11/7/06, Moataz Hussein <husseinmoataz@yahoo.com>
> wrote:
> >
> >
> > I do not re program, just power cycling.
> > nothing in the ram
> 
> 
> You're going to have to chase it out, debugging is
> where it really gets
> interesting.
> 
> One thing that I do on all my projects, is during
> init, before I set up
> anything that uses ram, I write all ram cells to
> zero.  This helps assure
> that everything starts from a known state.  If I
> ever forget to init a ram
> variable, at least it will start from the same
> state.
> 
> I've also been known to go change that to $FF or
> other values, hoping to
> uncover anything that was actually using an
> uninitted value.
> 
> 
> [Non-text portions of this message have been
> removed]
> 
> 




 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail.
http://new.mail.yahoo.com

Re: strange display

2006-11-08 by Stefan Wimmer

--- In AVR-Chat@yahoogroups.com, Moataz Hussein <husseinmoataz@...> 
wrote:
> ... 
> If it starts giving correct output it continues this
> way, also if it starts giving strange output it
> continues.

This sounds a lot like some uninitialized variables or such..
Are you using interrupts? Do you save SREG in ISRs?

> My question is:
> 1- Why is it sometimes working ok and stable and
> sometimes not? if it is getting correct output code
> why sometimes it is corrupted?

The error is in line 78 of your source code.

>>>> Oh, you didn't show it to us??

Then it might be somewhere else... ;-))

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.