[avr-gcc-list] LX-800 Printer driver

2008-04-17 Thread Andi
Hi, Does anyone ever make a LX-800 printer driver for AVR ? I make a code but it didn't work at all. Here my code : void InitPrinter(void) { // // Set Data Printer Direction as output DDRB = 0xFF; PORTB = 0; // Set Input BUSY signal cbi(DDRD,BUSY); sbi(PORTD,BUSY); // Set Output INIT

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Anatoly Sokolov
Hi. I wish to add: .. 3. builtin similarly to IAR '__delay_cycles'; .. This unfinished patch add '__builtin_avr_delay_cycles(long delay)' builtin to the avr backend. The 'delay' parameter should be constant. If 'delay' is 1 or 2 then one or two 'nop' instructions is generated. If

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Anatoly Sokolov
I wish to add: .. 3. builtin similarly to IAR '__delay_cycles'; .. This unfinished patch add '__builtin_avr_delay_cycles(long delay)' builtin to the avr backend. The 'delay' parameter should be constant. The patch attached. Anatoly.Index: gcc/config/avr/avr.md

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Wouter van Gulik
Anatoly Sokolov schreef: Hi. I wish to add: .. 3. builtin similarly to IAR '__delay_cycles'; .. This unfinished patch add '__builtin_avr_delay_cycles(long delay)' builtin to the avr backend. The 'delay' parameter should be constant. If 'delay' is 1 or 2 then one or two 'nop'

Re: [avr-gcc-list] RE: Patch Fix PR35013, PR27192

2008-04-17 Thread Wouter van Gulik
Andy H schreef: I think I have found a simple fix. I changed gcc so that offsets added to assembler symbols are doubled. So in c when we use foo+2 this gets send to assembler/linker as gs(foo+4). This has the effect that offsets or arithmetic are consistently in words - on a word

[avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread Ramazan Kerek
Hello, I have started using AT90CAN128 with WinAVR-20080402. I am having problem with with optimizatin flags. 1- When I use the following code along with -O1, -O2,-O3, -O4, -Os and whenI debug it, I do not see any change in PORTA. But when I built it with -O0, I see the changes in PORTA as I

RE: [avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread Weddington, Eric
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of Ramazan Kerek Sent: Thursday, April 17, 2008 1:16 AM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] optimization flags causes problems?? Hello, I have started using AT90CAN128 with

Re: [avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread Wouter van Gulik
Ramazan Kerek schreef: Hello, I have started using AT90CAN128 with WinAVR-20080402. I am having problem with with optimizatin flags. Do not use 20080402, use 20080411. HTH Wouter ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org

RE: [avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread Ramazan Kerek
Thanks alot. I will try it. Best Regards Ramazan Kerek -Original Message- From: Wouter van Gulik [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 11:31 AM To: Ramazan Kerek Cc: avr-gcc-list@nongnu.org Subject: Re: [avr-gcc-list] optimization flags causes problems?? Ramazan

RE: [avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread Ramazan Kerek
I have installed 20080411 and seen the same problems as I did in 20080402. Is there anything else I should try? Best Regards R. Kerek -Original Message- From: Weddington, Eric [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 11:31 AM To: Ramazan Kerek; avr-gcc-list@nongnu.org

Re: [avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread David Brown
Ramazan Kerek wrote: I have installed 20080411 and seen the same problems as I did in 20080402. Is there anything else I should try? What compiler flags did you use? If you compile the code you gave, use -O0 and -Os, what is the generated assembly code? Incidentally, why are you writing

RE: [avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread Ramazan Kerek
Please see my comment on your questions below. Best Regards R. Kerek What compiler flags did you use? - -Wall, -gdwarf-2, -std=gnu99, -O0, -funsigned-char, -funsigned-bitfields, fpack-struct, -fshort-enums If you compile the code you gave, use -O0 and -Os, what is the generated assembly

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Oleksandr Redchuk
2008/4/17, Wouter van Gulik [EMAIL PROTECTED]: For a 2 cycles delays an rjmp can be used. Saves an instruction! And so on: 3 cycles: rjmp . nop 4 cycles: rjmp . rjmp . 5 cycles: rjmp . rjmp . nop 6 cycles: rjmp . rjmp . rjmp . All code portions use no more program

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Oleksandr Redchuk
2008/4/17, Oleksandr Redchuk [EMAIL PROTECTED]: 7 to 756 ldi rX, (delay/3) 1:dec rX brne 1b is generated. 'ldi' instruction can be removed by optimizer. and removed ldi instruction execution time (1 cycle) for 7+ cycles will produce less relative error than for 3..6

Re: [avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread David Brown
Ramazan Kerek wrote: Please see my comment on your questions below. Best Regards R. Kerek What compiler flags did you use? - -Wall, -gdwarf-2, -std=gnu99, -O0, -funsigned-char, -funsigned-bitfields, fpack-struct, -fshort-enums Try compiling with -mmcu=atmega128. Without an appropriate

Re: [avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread Joerg Wunsch
Ramazan Kerek [EMAIL PROTECTED] wrote: 2-I am using EEPROM_Write/Read functions in my project. When I compile the project with -O0 option, and start dtata transfer to EEPROM memory, I do not see any transfer to EEPROM memory. As you told the compiler to not optimize, the generated code is

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Anatoly Sokolov
Hi. 2008/4/17, Wouter van Gulik [EMAIL PROTECTED]: For a 2 cycles delays an rjmp can be used. Saves an instruction! And so on: 3 cycles: rjmp . nop I shall try to replace 'nop' with 'rjmp .' for two cycle delay. It is necessary to check that the linker relaxation pass will

RE: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Weddington, Eric
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of Anatoly Sokolov Sent: Thursday, April 17, 2008 3:44 PM To: Oleksandr Redchuk; avr-gcc-list@nongnu.org Subject: Re: [avr-gcc-list] Add builtins in avr target. Hi. 2008/4/17, Wouter

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Dmitry K.
On Friday 18 April 2008 12:56, Weddington, Eric wrote: 2008/4/17, Wouter van Gulik [EMAIL PROTECTED]: For a 2 cycles delays an rjmp can be used. Saves an instruction! And so on: 3 cycles: rjmp . nop I shall try to replace 'nop' with 'rjmp .' for two cycle delay.

Re: [avr-gcc-list] LX-800 Printer driver

2008-04-17 Thread Blake Leverett
On Thursday 17 April 2008, Andi wrote: Hi, Does anyone ever make a LX-800 printer driver for AVR ? I make a code but it didn't work at all. Here my code : snip code int main(void) { SendStringToPrinter(System Ready !\r\n); for (;;){ } } Anyone can help me ? This probably

RE: [avr-gcc-list] optimization flags causes problems??

2008-04-17 Thread Ramazan Kerek
Thank very much for the detailed answer about EEPROM timing and why using the lib is better chose. Best Regards Ramazan Kerek -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joerg Wunsch Sent: Thursday, April 17, 2008 11:11 PM To: