Forbiden tech from China has arrived :-)

Go To Last Post
106 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Something very weird just happened I can't edit, please delete the above post, and this one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are only quibbling over the LGT target that you have never even used.

Never used, true.  Quibbling, false. ;-)

 

__DELAY_BACKWARD_COMPATIBLE__

That doesn't fix anything.  No matter how many times you define it ;-)

 

All it does is avoid the use of __builtin_avr_delay_cycles() in favour of _delay_loop_1() and _delay_loop_2().  The latter still relies on the use of sbiw, and the 'fact' that it takes two cycles.  Only _delay_loop_1() avoids sbiw, and is only used by _delay_us() for very short delays (less than 256 loops, or 'ticks', at F_CPU).

 

It's all a tempest in a teapot.  I only started down this road when @ki0bk joked about faking F_CPU, and I responded while acknowledging the joke.  I don't really care one way or the other, since as David points out I haven't used the LGT, nor am I likely to.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Something very weird just happened I can't edit, please delete the above post, and this one.

I bet I know what.  You copied __DELAY_BACKWARD_COMPATIBLE__ from the online AVR Libc docs, and tried to paste into a forum post.  The docs use a BBcode-like formatting which employs square brackets.  The forum software will happily display it correctly once posted, but the editor Javascript will not.  You paste, but see nothing.  It's there, so when you click post, it appears.

 

I guess you pasted a few times, wondering why you couldn't see it... ;-)

 

Blame the saxophone players.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeap, it was exactly that cheeky

But anyway, __DELAY_BACKWARD_COMPATIBLE__ combined with editing this line:

__tmp2 = ((F_CPU) / 4e6) * __us;

replacing 4e6 by a define that can be 4e6 for normal AVRs or 3e6 for LGT AVRs would work and it's just a minor edit.

 

edit: well, for _delay_us at least... _delay_ms also needs edits.

Last Edited: Thu. Sep 28, 2017 - 11:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As the timing is actually delivered by __builtin_avr_delay_cycles(), that is what should be modified.

 So ... what would be the procedure/logistics for getting separate "clone" CPUs that are "almost like X" added to avr-gcc ?  Atmel (Microchip) is more-or-less gatekeeper of new devices for avr-gcc, right?

SBIW is not the only timing difference with these chips; I'll bet that things like VUSB and Atomic Zombie's video code break as well...

 

(BTW: these are very good observations - thank you for poking around at the chip!)

 

Pages