delay_x.h transplant on AVR32 UC3B

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys,

Just finished a AVR32 version of the handy delay_x.h function.

I have enclosed the file, I just tested it a little bit on UC3B0256, and it seems working, more test will be great.

Any feedback is appreciated.

Cheng

Attachment(s): 

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

I just found out that this delay_x.h function is not accurate if AVR32 is running faster than 30MHz. This is because the extra delay for FLASHC. I will try to find the fix.

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

ok, just done the fix.

I tested it a little bit and it's delay is correct now for F_CPU > 33000000Hz.

I assume that if F_CPU is faster than 33MHz, then brne would take 4 clks instead of 3 clks, due to one extra wait for slow FLASH.

But I'm still wondering what could hapeen if multiple masters in HMATRIX connect to internal slave FLASH, would this change the number of clks to read FLASH?

Anyone knows?

Attachment(s):