Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
grexa178
PostPosted: Jan 07, 2010 - 10:29 PM
Newbie


Joined: Jun 13, 2008
Posts: 2


Hi to all.
I want to ask if it is possible to run program for atmega8515 on atmega8.
It is from site http://www.swinkels.tvtom.pl/swinsid/
in download section - version SE
there is an source code and schematic.

IS it possible to compile that code for atmega8? and will it be pin compatibile?

Can somebody do it for me? Wink

Thanks for the answers.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Jan 07, 2010 - 10:33 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 20339
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Quote:
it is possible to run program for atmega8515 on atmega8.
Mostly with some small changes.
Quote:
Can somebody do it for me?
No problems, just pm me and I'll give you a price. Paypal payment will be ok.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Koshchi
PostPosted: Jan 07, 2010 - 10:36 PM
10k+ Postman


Joined: Nov 17, 2004
Posts: 13820
Location: Vancouver, BC

All AVRs have the same (or nearly the same) core, so much of the code would work. But there are differences in peripherals. Some cases would require minor changes in code, some majors changes, and some may be impossible due to the fact that a peripheral may not exists at all on the model you want to port to. In any case, the mega8515 and mega8 are not pin compatible. The don't even have the same number of pins.

Is there a particular reason that you want to use the mega8?

_________________
Regards,
Steve A.

The Board helps those that help themselves.
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 07, 2010 - 10:42 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

It IS possible to rearrange the pinout, modify the code and reassemble it for Mega8.
It is NOT possible to assemble and run this code directly on Mega8 without the said modifications.

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
grexa178
PostPosted: Jan 08, 2010 - 12:27 PM
Newbie


Joined: Jun 13, 2008
Posts: 2


I want to use atmega8 because I own few from previous project. Even if buy they are cheaper.
But
It looks like lot of work, better buy 8515 and build that dual version I think that would be probably better.

Thanks for the replies.
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 08, 2010 - 12:53 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

Adapting this code for Mega8 would take just 10 minutes for a knowledgeable engineer.

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
johnwarfin
PostPosted: Jan 08, 2010 - 04:05 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

9 out of 10 of my 8515 binary images run on a m8 and versa visa. This is one of the biggest reasons for bit banging instead of showing off with unique processor features.
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 08, 2010 - 04:21 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

Look at the OP's schematics and see this is not the case.

BTW, how were the hats - tasty? All 16? Very Happy Very Happy Very Happy

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
johnwarfin
PostPosted: Jan 08, 2010 - 04:55 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

MBedder wrote:
BTW, how were the hats - tasty? All 16? Very Happy Very Happy Very Happy


I'm guessing you didn't read the rest of that thread. Or more accurately didn't WANT to read it.

First, you were being played from the start. There is no way you could have written a "smaller program". Unless you know how to set up a PIC bit with a ZERO byte program.

Second, even for same size you failed to "turn on an LED". As I mentioned, turning on other bits than intended can be catastrophic. This is one of the reasons AVR code always has and always will be more compact and faster than PIC.

Lah-Hooooooooooo-Zer! Smile Smile Smile
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 08, 2010 - 05:22 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

So you didn't like the hats - it's as expected. Since you also didn't like to take a challenge other than writing a zero length program, I'm completely satisfied.

The last thing I have to tell to save you from being mocked: during last several years I have ported about a dozen of my commercial projects from Mega's to PIC24's/dsPIC's (assembly to assembly). Comparisons and testings indicated the resulting PIC24/dsPIC code size became 10%..20% less in BYTE size (despite the PIC24/dsPIC has a 24 bit wide code memory vs 16 bit in AVR) and 6..10 times faster than original AVR code.

Be well then Very Happy Very Happy Very Happy

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jan 08, 2010 - 05:45 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62241
Location: (using avr-gcc in) Finchingfield, Essex, England

A PIC vs AVR war? Great! Let's see .... we haven't had one of those since at least...

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 08, 2010 - 05:52 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

No, nothing like this - each family has its niche, advantages and drawbacks. I'm just informing one proud and generous hat eater of the real things Very Happy

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
Koshchi
PostPosted: Jan 08, 2010 - 06:19 PM
10k+ Postman


Joined: Nov 17, 2004
Posts: 13820
Location: Vancouver, BC

Quote:
I'm just informing one proud and generous hat eater of the real things

A) It has nothing to do with this thread.
B) We don't give a s*#&.

So, take it somewhere else.

_________________
Regards,
Steve A.

The Board helps those that help themselves.
 
 View user's profile Send private message  
Reply with quote Back to top
johnwarfin
PostPosted: Jan 08, 2010 - 08:49 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

at 12:45pm clawson wrote:
A PIC vs AVR war? Great! Let's see .... we haven't had one of those since at least...


12:32 pm.

Nyaa nyaaa... pixie can't even wiggle a bit with smaller program than AVR guy. Or even same size. Well what should we expect from archirecture designed before most here were born? Nyaaa nyaaaa... Smile

Hey... MBedder... maybe try 8051. or 8008.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Jan 08, 2010 - 09:00 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 20339
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Quote:
9 out of 10 of my 8515 binary images run on a m8 and versa visa.
..even if the pins or ports are not there. Amazing!

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
johnwarfin
PostPosted: Jan 08, 2010 - 09:10 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

js wrote:
Quote:
9 out of 10 of my 8515 binary images run on a m8 and versa visa.
..even if the pins or ports are not there. Amazing!


Well... that's why it's not 10 out of 10. But you are right, I am amazing.
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Jan 08, 2010 - 09:12 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 25891
Location: Wisconsin USA

Quote:

..even if the pins or ports are not there. Amazing!

And vector tables? Who needs newfangled interrupts? Remember that

Quote:
Unfortunately it's impossible to generate a proper RC PWM signal with AVR OC

http://www.avrfreaks.net/index.php?name ... torder=asc
 
 View user's profile Send private message  
Reply with quote Back to top
johnwarfin
PostPosted: Jan 08, 2010 - 09:25 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

theusch wrote:
And vector tables? Who needs newfangled interrupts?


Not me if I can help it. INTs r 4 losers.

Quote:
Unfortunately it's impossible to generate a proper RC PWM signal with AVR OC


I should have said USEABLE servo signals. Your method doesn't work for the RC guys because they can't sacrifice channels.

You did good though. Much better at that stuff than me. As everybody knows I hate spec sheets.
 
 View user's profile Send private message  
Reply with quote Back to top
zbaird
PostPosted: Jan 08, 2010 - 09:29 PM
Raving lunatic


Joined: Aug 13, 2006
Posts: 6696
Location: Bellingham, WA - USA

Quote:
As everybody knows I

We're all following you like a soap opera.

_________________
Chuck Baird
"It's better to catch the trapeze than test the safety net" -- RPi book
http://www.cbaird.org
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
js
PostPosted: Jan 08, 2010 - 09:31 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 20339
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

More like a HORROR movie. I hope none of the stuff he has "designed" is used to save or preserve people's lives. Shocked

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
johnwarfin
PostPosted: Jan 08, 2010 - 10:12 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

js wrote:
More like a HORROR movie. I hope none of the stuff he has "designed" is used to save or preserve people's lives. Shocked


FYI interrupts are not the path to truly deterministic code. And let's not talk about debugging, code verification, or portability.

You have my permission to sprinkle them EVERWHERE yourself. INTs r 4 U!
 
 View user's profile Send private message  
Reply with quote Back to top
zbaird
PostPosted: Jan 08, 2010 - 10:44 PM
Raving lunatic


Joined: Aug 13, 2006
Posts: 6696
Location: Bellingham, WA - USA

Out of curiosity, why is "truly deterministic" code necessarily an appropriate response of an interactive system responding to external stimuli?

_________________
Chuck Baird
"It's better to catch the trapeze than test the safety net" -- RPi book
http://www.cbaird.org
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
geoelec
PostPosted: Jan 08, 2010 - 11:32 PM
Resident


Joined: Jan 26, 2009
Posts: 534
Location: Thessaloniki Greece

First check the interrupt vector table between two micros,the stack pointer,peripheral registers and port registers.And everything can be tested and compiled in Avrstudio.
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 09, 2010 - 01:23 AM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

Just in case somebody is interested in a 8-bit (256 steps) multi-channel software PWM implementation, I'm pleased to share my code written several years ago.

It takes slightly more than 2 CPU clocks per channel and is usable in a wide range of applications. With 100% 16 MIPS CPU load it generates over 2 KHz 8-bit 8-channel PWM or 500 Hz 8-bit 8-channel PWM with only 25% CPU load:

Code:

;-----------------------------------------------------------------------------------------
;
; 8 channel interrupt driven 8-bit (256 steps) software PWM implementation example.
; r3..r10 hold channel duty cycle values
; PORTB pins are PWM channels' outputs (port can be redefined via PWMPORT alias)

.include        "tn2313def.inc"

.def    STSAV   = r2            ; SREG holding register for all non-nested interrupts
.def    pwm     = r15           ; PWM digital sawtooth generator used in  Timer 1 ISR
.def    tmp     = r16           ; General purpose temporary register
.def    inttmp  = r25           ; Common temporary register for all non-nested interrupts

.equ    pwmport = PORTB         ; PWM output port

.equ    fosc    = 16000000              ; CPU clock frequency, Hz
.equ    fpwm    = 2000                  ; Desired PWM frequency, Hz (2050 Hz max @16 MIPS)

.set    t1val   = fosc/fpwm/256-1       ; Timer 1 TOP reload value for given FPWM and FOSC

.if (t1val < 30)                ; Timer 1 ISR takes up to 30 clocks to execute
.warning "Selected PWM frequency is too high, forcing highest available (full CPU usage!)"
.set    t1val   = 30
.endif

.cseg
;-----------------------------------------------------------------------------------------
; Interrupt vectors:
        rjmp    reset

.org    OC1Aaddr
        rjmp    OC1Aisr
;-----------------------------------------------------------------------------------------

;-----------------------------------------------------------------------------------------
reset:
        ldi     tmp,low(RAMEND)
        out     SPL,tmp        ; Stack pointer initialization
.ifdef  SPH
        ldi     tmp,high(RAMEND)
        out     SPH,tmp
.endif

        ldi     tmp,0xFF        ; Set up PB0..7 as outputs
        out     DDRB,tmp

        ldi     tmp,32*1        ; Initialize r3..r10 (PWM channel values)
        mov     r3,tmp          ;
        ldi     tmp,32*2        ;
        mov     r4,tmp          ;
        ldi     tmp,32*3        ;
        mov     r5,tmp          ;
        ldi     tmp,32*4        ;
        mov     r6,tmp          ;
        ldi     tmp,32*5        ;
        mov     r7,tmp          ;
        ldi     tmp,32*6        ;
        mov     r8,tmp          ;
        ldi     tmp,32*7        ;
        mov     r9,tmp          ;
        ldi     tmp,32*8-2      ;
        mov     r10,tmp         ;

        rcall   init_timer1     ; Set up Timer 1

        sei                     ; Enable interrupts

        rjmp    PC              ; Loop forever
;-----------------------------------------------------------------------------------------

;-----------------------------------------------------------------------------------------
; Timer 1 initialization (Clear Timer on Compare match - CTC mode).
; Timer 1 runs at Fosc in CTC mode with overlow rate derived from a desired PWM frequency.

init_timer1:
        ldi     tmp,high(t1val)         ; Initialize TOP register (OCR1A) and Timer 1:
        out     OCR1AH,tmp              ; High byte first
        out     TCNT1H,tmp              ; Reset Timer 1 to get correct 1st result
        ldi     tmp,low(t1val)          ;
        out     OCR1AL,tmp              ; Low byte last
        out     TCNT1L,tmp              ;

        ldi     tmp,(1<<WGM12)|(1<<CS10) ; CTC mode, T1CLK = Fosc
        out     TCCR1B,tmp              ;

        in      tmp,TIMSK               ; Enable OC1A interrupts
        sbr     tmp,1<<OCIE1A           ;
        out     TIMSK,tmp               ;

        ret
;-----------------------------------------------------------------------------------------

;-----------------------------------------------------------------------------------------
; Timer1 (CTC mode) compare match ISR - single 8-bit software PWM step.
; 24 clocks, 21 program words

OC1Aisr:
        in      stsav,SREG      ; Save SREG to STSAV reserved register
 
        inc     pwm             ; Advance PWM sawtooth generator
 
        cp      r3,pwm          ; CARRY = 1 if Rx <= PWM - 2 clocks per PWM channel
        rol     inttmp          ; Shift in the CARRY to an INTTMP
        cp      r4,pwm          ; CARRY = 1 if Rx <= PWM - 2 clocks per PWM channel
        rol     inttmp          ; Shift in the CARRY to an INTTMP
        cp      r5,pwm          ; CARRY = 1 if Rx <= PWM - 2 clocks per PWM channel
        rol     inttmp          ; Shift in the CARRY to an INTTMP
        cp      r6,pwm          ; CARRY = 1 if Rx <= PWM - 2 clocks per PWM channel
        rol     inttmp          ; Shift in the CARRY to an INTTMP
        cp      r7,pwm          ; CARRY = 1 if Rx <= PWM - 2 clocks per PWM channel
        rol     inttmp          ; Shift in the CARRY to an INTTMP
        cp      r8,pwm          ; CARRY = 1 if Rx <= PWM - 2 clocks per PWM channel
        rol     inttmp          ; Shift in the CARRY to an INTTMP
        cp      r9,pwm          ; CARRY = 1 if Rx <= PWM - 2 clocks per PWM channel
        rol     inttmp          ; Shift in the CARRY to an INTTMP
        cp      r10,pwm         ; CARRY = 1 if Rx <= PWM - 2 clocks per PWM channel
        rol     inttmp          ; Shift in the CARRY to an INTTMP
 
        out     pwmport,inttmp  ; Set PWM 1..8 pins to new states

        out     SREG,stsav      ; Restore SREG from STSAV reserved register
        reti
;-----------------------------------------------------------------------------------------


Last edited by MBedder on Jan 09, 2010 - 08:41 AM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
zbaird
PostPosted: Jan 09, 2010 - 01:36 AM
Raving lunatic


Joined: Aug 13, 2006
Posts: 6696
Location: Bellingham, WA - USA

No stack initialization?

_________________
Chuck Baird
"It's better to catch the trapeze than test the safety net" -- RPi book
http://www.cbaird.org
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
MBedder
PostPosted: Jan 09, 2010 - 01:53 AM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

Exactly. Guess why Very Happy

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
Koshchi
PostPosted: Jan 09, 2010 - 03:32 AM
10k+ Postman


Joined: Nov 17, 2004
Posts: 13820
Location: Vancouver, BC

Quote:
Exactly. Guess why

Because you want the program to fail at the first RCALL?

_________________
Regards,
Steve A.

The Board helps those that help themselves.
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 09, 2010 - 08:44 AM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

No, just due to a copy/paste mistake. BTW, for this particular code and device this was not necessary - guess why Very Happy Very Happy

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Jan 09, 2010 - 02:57 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 25891
Location: Wisconsin USA

Without looking it up, Tiny2313 probably has SP at RAMEND at reset anyway.

Again without looking it up, this sounds a lot like the Atmel app note on "multiple PWMs" or something like that.

With only one interrupt source enabled, an app like that would have little jitter and it wouldn't be accumulative as noted in the Atmel app note.

I guess if jitter was a problem in, say, a multi-channel hobby servo the "secondary" data channels such as UART or trigger I/Os or heartbeat timers could be polled.

Lee
 
 View user's profile Send private message  
Reply with quote Back to top
johnwarfin
PostPosted: Jan 09, 2010 - 03:03 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

zbaird wrote:
Out of curiosity, why is "truly deterministic" code necessarily an appropriate response of an interactive system responding to external stimuli?


Mostly for runtime validation and testing. It get's particularly bad when multiple ints are involved. You can get high reliabilty figures but never quite reach 100% unlike deterministic code which can. And then there are the development issues (debugging) which become orders of magnitude more difficult with interrupts.

They are somtimes necessary but are hugely over-used, specially by inexperienced designers who like to show off instead of get the job done. Kinda like with processor specific peripherals. You know, the guys that use a timer to blink an LED. :rolleyes:
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 09, 2010 - 04:08 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

theusch wrote:
Without looking it up, Tiny2313 probably has SP at RAMEND at reset anyway.

Nope - its at 0x00 at reset.
The answer is simple - since my code is less than 256 words long and doesn't use nested calls/pushes, a single level 8-bit stack location is enough. This location (0x00) is mapped to an R0 register which is not used anywhere else in my code.

When a call or interrupt occurs the caller's PCL is saved to R0, then SP gets underflown to 0xFF and the caller's PCH is attempted to be saved to an unimplemented RAM location which simply does not perform any action. At RET/RETI the caller's PCH gets read from the said unimplemented location which yields to a 0x00 value. Then SP gets incremented pointing to R0 so the caller's PCL as well the entire PC gets properly restored.

Quote:
Again without looking it up, this sounds a lot like the Atmel app note on "multiple PWMs" or something like that.
I've never read that appnote. My code was written to demonstrate the AVR advantages over PIC18 in one of the numerous AVR vs PIC holy wars on one of the Russian technical forums.

The opponents tried to prove that the PIC18 code takes 2 instruction per PWM channel (taking advantage of PIC's DECFSZ instruction missing in AVR) whereas AVR code takes 3. I (aka AVR that times Smile) realized how to do it in two AVR instruction per channel and proposed this 24-channel PWM code which accumulates the channel/sawtooth comparison results in a register and then outputs the whole 8-bit value to a port. The opponents had fled from the battlefield in shame and fear, and the AVR was completely avenged and acquitted Very Happy

P.S. Sorry, the URLs above are in Russian.
 
 View user's profile Send private message  
Reply with quote Back to top
johnwarfin
PostPosted: Jan 09, 2010 - 05:16 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

MBedder wrote:
theusch wrote:
Without looking it up, Tiny2313 probably has SP at RAMEND at reset anyway.

Nope - its at 0x00 at reset.


Quote:

SP7 SP6 SP5 SP4 SP3 SP2 SP1 SP0 SPL
7 6 5 4 3 2 1 0
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value 1 0 0 1 1 1 1 1


Theusch apparently "bedder" at AVR than PICboy.

PS Generating legal servo siganls IS one of the few areas PIC has it over AVR. That and external access to op amp.
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 09, 2010 - 05:37 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

17th hat to eat - shouldn't be that easy, cowboy Very Happy Very Happy Very Happy
 
 View user's profile Send private message  
Reply with quote Back to top
johnwarfin
PostPosted: Jan 09, 2010 - 06:39 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

MBedder wrote:
17th hat to eat - shouldn't be that easy, cowboy Very Happy Very Happy Very Happy


Sorry. I had tiny13.

As far as hats you seem unable to differentiate between changing a port and changing a bit but also appear to think you can turn on an LED with 0 lines of code. To reiterate, you were suckered from the start when I challenged you to write a smaller program than my one liner.

Keep ignoring these simple realities as it's very entertaining. Again and again. I certainly never get tired of pointing this out. Smile
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 09, 2010 - 06:51 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

18th Very Happy Very Happy Very Happy
 
 View user's profile Send private message  
Reply with quote Back to top
johnwarfin
PostPosted: Jan 09, 2010 - 06:53 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

LOL! You sound like you're upset. Are you upset? Smile Smile Smile Smile Smile
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 09, 2010 - 07:00 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

Huh? Me?? How could I get upset with a boyscout hat eater who does not wear glasses and thinks that everything in this world was done with a Photoshop??? C'mon, cowboy - I already got tired to LOL Very Happy Very Happy Very Happy

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
johnwarfin
PostPosted: Jan 09, 2010 - 07:16 PM
Hangaround


Joined: Dec 29, 2009
Posts: 160
Location: ny,ny

Uh oh... I think he's upset. He's definitely upset.

And apparently read my post before discoveing the error. Welp... at least SOME of us are able to admit we made a mistake.
BTW I only said I'd eat ONE hat if you could turn on an LED with a PIC using less than one line of code. And never mentioned hats on the SPL deal. Not too good at math, are we? 0, 1, 16, 17, 18?

LOL!
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Jan 09, 2010 - 09:12 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 25891
Location: Wisconsin USA

Quote:

The opponents had fled from the battlefield in shame and fear, and the AVR was completely avenged and acquitted

Wink

In all the Holy Wars, it must be remembered that a specific "trick" only matters in the edge-condition situations. In general, micros aren't totally full and are loafing.

E.g., your stack trick above--who cares if the micro is 2% full or 3% full, or if it takes a microsecond longer to complete startup?

Quote:

I've never read that appnote.

AVR136: Low-jitter Multi-channel Software PWM
http://www.atmel.com/dyn/resources/prod ... oc8020.pdf
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Jan 10, 2010 - 09:24 AM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

As I stated above, it was not a trick but just a copy/paste error. But since I tested that the code is working before posting it here, I wondered why, so I analyzed the details and posted my explanation above.

Thanks for the link. BTW according to its code it works 8 times slower than my code.

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Jan 10, 2010 - 02:33 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 25891
Location: Wisconsin USA

Quote:

it works 8 times slower than my code.

Well, yaahhhh--it was not written by a 'Freak, but rather by "an Atmel
certified Field Applications Engineer".

(And app notes may never be the fastEST or tightEST--there is something to be said for making them as straightforward and practical as possible so that many levels can understand them.)

Lee
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits