Yahoo Groups archive

AVR-Chat

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

Thread

AVR GCC settings

AVR GCC settings

2013-05-12 by Dave McLaughlin

Hi All,

 

I am trying to get Zigbee working with an Arduino board. A Mega2560.

 

I am not using Arduino, instead I am using AVR Studio 6.1 and GCC as I need
64 bit integers. My normal Codevision compiler does not currently support
these.

 

The issue is that I can't get any response from the AVR at 9600 bps. I have
configured the system for 16Mhz and the baud rate registers should be 103
with no clock div 8 fuse setting.

 

I have reprogrammed the fuses so that the bootrst is off so my software runs
instead. I can confirm this with the JTAG ICE3 connected.

 

I hooked up a logic analyser and enabled the UART decoder on this and the
bytes do not match at all. The first byte should be 0x7E but I am seeing
0xA0 so something timing wise is way out.

 

The fuses are set for external xtal osc. The board is fitted with 16Mhz. I
configure the CLKPR = 1; for division of 1.

 

Am I missing something else with the configuration or the startup code of
the device in AVR GCC?

 

The strange thing is that the timer1 interrupt for 1m is working.

 

Appreciate any pointers as I am new to using AVR GCC, coming from
Codevision.

 

 

Regards

Dave. 



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

RE: [AVR-Chat] AVR GCC settings

2013-05-12 by Dave McLaughlin

My mistake, it is:

 

CLKPR = 1 << 7;
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Dave McLaughlin
Sent: 12 May 2013 22:43
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] AVR GCC settings

 

  

Hi All,

The fuses are set for external xtal osc. The board is fitted with 16Mhz. I
configure the CLKPR = 1; for division of 1.

Regards

Dave. 





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

Re: [AVR-Chat] AVR GCC settings

2013-05-12 by David VanHorn

Never hurts to include parens.  CLKPR = (1<<7);


On Sun, May 12, 2013 at 10:02 AM, Dave McLaughlin <
dave_mclaughlin@nerdshack.com> wrote:

> My mistake, it is:
>
>
>
> CLKPR = 1 << 7;
>
>
>
>
>
> From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
> Of Dave McLaughlin
> Sent: 12 May 2013 22:43
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] AVR GCC settings
>
>
>
>
>
> Hi All,
>
> The fuses are set for external xtal osc. The board is fitted with 16Mhz. I
> configure the CLKPR = 1; for division of 1.
>
> Regards
>
> Dave.
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>


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

RE: [AVR-Chat] AVR GCC settings

2013-05-13 by Dave McLaughlin

My bad. I was using parenthesis. It was a long day.

 

 

I found the fault. The analyser was set for negative logic and it should
have been positive. 

 

I could then see that there was escape characters in the telemetry but my
Xbee modules where configured without them.

 

:)

 

Dave.
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of David VanHorn
Sent: 12 May 2013 23:18
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] AVR GCC settings

 

  

Never hurts to include parens. CLKPR = (1<<7);

On Sun, May 12, 2013 at 10:02 AM, Dave McLaughlin <
dave_mclaughlin@nerdshack.com <mailto:dave_mclaughlin%40nerdshack.com> >
wrote:

> My mistake, it is:
>
>
>
> CLKPR = 1 << 7;





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

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.