Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] Re: comms problem

2008-04-06 by John Samperi

At 01:51 PM 6/04/2008, you wrote:
>I am using the atmega16l. I programmed the fuse bits for internal
>4Mhz. When I read the stk500 osc in studio4 it says 3.686Mhz.

Ok things are a bit clearer now. With the STK500 you have to put the
OSCSEL jumper correctly. You can have the internal clock, the external
crystal clock or the STK500 generated clock which is what you are reading
with Studio. Read up on the OSCSEL to see how to set this correctly,
it's in the Studio help file as well as the docs you got with the STK.
The one in Studio is the latest.

>I have
>tried various baud rate setting +/- a couple from $51 to UBRRL.

Get the above correct first.

>As far as I know, when using lpm the result is stored in r0.

Correct, so it will work as you have it, however the chip will also
support the more advanced version I showed you ant you save a bit of
code. Not important at the moment

>But trying to pull data from ram

The program is NOT reading data from ram but from flash with lpm.
Your string is stored in flash, so unless you have a routine to read
it from there and put it into ram you will be reading random rubbish.

HOWEVER if you want to read from ram lpm is not good, you will need to
use lds.


Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Attachments

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.