ATMEGA809 EVSYS Errata

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

I've come across an issue with the event system on ATMEGA809. It seems only channels 0 & 1 are function. Channels 2-7 are non-functional.

These two code snippet both work (I see the timer tick on EVOUT):

	EVSYS.CHANNEL0 = EVSYS_GENERATOR_TCA0_OVF_LUNF_gc;
	EVSYS.USEREVOUTF = EVSYS_CHANNEL0_bm;

	EVSYS.CHANNEL1 = EVSYS_GENERATOR_TCA0_OVF_LUNF_gc;
	EVSYS.USEREVOUTF = EVSYS_CHANNEL1_bm;

Higher channel numbers output nothing. Implication are ports C/D/E/F pins cannot be used as event generators since these are not covered with CH0/1.

 

Chip details:

ICE/Studio reports RevA

Chip markings indicate birthday week 25/2019

Errata sheet suggest RevA is equivalent to RevB of larger siblings

AFR part suffix is tape&reel but was deliver on tray (from Digikey) -- probably just supply-chain issue.

 

I have 808s and 4809s I can test with to investigate the breadth of the issue.

 

 

 

 

This topic has a solution.
Last Edited: Thu. Mar 24, 2022 - 08:34 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are not doing it right.

 

The channel registers don't take masks like EVSYS_CHANNEL1_bm. The correct way is:

 

	EVSYS.CHANNEL0 = EVSYS_GENERATOR_TCA0_OVF_LUNF_gc;
	EVSYS.USEREVOUTF = EVSYS_CHANNEL_CHANNEL0_gc;

	EVSYS.CHANNEL1 = EVSYS_GENERATOR_TCA0_OVF_LUNF_gc;
	EVSYS.USEREVOUTF = EVSYS_CHANNEL_CHANNEL1_gc;
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yup, that's it. Guess I shouldn't blindly accept IntelliSense suggestions.

 

 

IntelliSense would certainly be more useful if the io.h files had the peripheral structs-of-register-types unioned with structs-of-enum-types. <sigh>

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

Lucky me that I always confirm the values of those constants - either by going to the definition, or by pop up info (in microchip studio you have to set cursor in it and look for the value somewhere on top of the code)

Computers don't make errors - What they do they do on purpose.

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

I'll certainly be using the drop-down list of typedefs in the future. I use it all the time for functions, just ignored it in header files.

 

Goto Definition is kinda buggered for me though. I have five different processors used in the solution. It's hit-or-miss if the correct io header opens.

 

Multiple procs may contribute to my issues with code-completion as well. Across the processor lines the event system naming is pretty divergent.