[Top][All Lists]

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

[avr-gcc-list] Problem with difference between WinAVR versions - Help p

From: Peter Bozzay
Subject: [avr-gcc-list] Problem with difference between WinAVR versions - Help please!
Date: Wed, 01 Sep 2004 09:48:39 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)


I have written about this problem with 1wire driver in Avrfreaks project
#059. I would like to solve it now anyway, so I tried to examine it
closer, and I have these experiences:

I striped the code to remain only the necessary parts in ds18x20.x and
one_wire.x files, and made a very simple project, what uses only these
files. The makefile is the template of 20040404.
The generated code works fine with Winavr20030115 and 20030312 versions,
but not with 20030913 and 20040404! It seems something changed in some
part of 20030913, what causes it.
I tried to compare the different Winavr versions generated files. I can
see significant difference only in one_wire.lst file of 20030312 and
The one_wire.c and .h are full of macro expressions and have some asm parts.
I examined the 1wire bus with oscilloscope and logic analyser, and all
signals, all delays seems ok with all 4 Winavr versions! And I saw,
that the problem must be only with get data from the bus in ow_get_bit
function, and finally I found this:

inline unsigned char ow_get_bit(void)
        unsigned char x=0,global_int_mem=0;
        if(inp(SREG)&0x80) { asm("cli"); global_int_mem=1; }

        sbi(PORTB,2); // test


        cbi(PORTB,2); //test line 1

        //if( BIT_IS_SET(ow_pin_reg, ow_pin )) { x=1; } //original line
        if (bit_is_set(PINB,3)) {x=1;} //test line with same result

//      cbi(PORTB,2); //test line 2


        if(global_int_mem) { asm("sei"); }

The generated .hex file is exactly the same when I use test line 2
instead of test line 1, so it seems, that the heart of the function is
missing from generated code!

I would be very happy if somebody can help me to look into the code,
and help to solve this problem, or can tell me more about possible
differences, what causes this.

The last main project made by 20040404, so I would have to use this

I have placed my test code with generated files here:

Have a nice day,
Peter Bozzay

(I couldn't send this email days ago, so I could try the 20040720
version, too. It's the worst of all, no signals, no delays, and the main
project code doesn't work, too.)

reply via email to

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