Atmel Start bug generating code for driver TC:LITE:Timer with 8 bits counter mode

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

Hello,

 

Atmel start write in generate code 0x02 for TC_CTRLA_MODE_Pos (as you can see below) although you select 8 bits counter mode in driver TC:LITE:Timer, as you can see in the photo

 

code extract ...

 

int8_t TIMER_0_init()
{

    hri_tc_wait_for_sync(TC0);
    if (hri_tc_get_CTRLA_ENABLE_bit(TC0)) {
        return ERR_DENIED;
    }

    hri_tc_write_CTRLA_reg(TC0,
                           0 << TC_CTRLA_PRESCSYNC_Pos       /* Prescaler and Counter Synchronization: 0 */
                               | 0 << TC_CTRLA_RUNSTDBY_Pos  /* Run in Standby: disabled */
                               | 0 << TC_CTRLA_PRESCALER_Pos /* Setting: 0 */
                               | 0 << TC_CTRLA_WAVEGEN_Pos   /* Waveform Generation Operation: 0 */
                               | 0x2 << TC_CTRLA_MODE_Pos);  /* Operating Mode: 0x2 */

    // hri_tc_write_CTRLB_reg(TC0,0 << TC_CTRLBSET_CMD_Pos /* Command: 0 */
    //         | 0 << TC_CTRLBSET_ONESHOT_Pos /* One-Shot: disabled */

 

thanks

regards

 

Attachment(s): 

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

Is this a new Atmel Start project or did you change the setting and forget to generate the new code?  What chip are you using?

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Mon. Jan 15, 2018 - 08:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

first of all, thank you por your answer

 

chip: atsamd20g16.

 

It also happens with new projects.

 

regards

 

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

Latest datasheet for the ATSAMD20 http://ww1.microchip.com/downloa...

 

See page 490;

 

Bits 3:2 – MODE[1:0] Timer Counter Mode
These bits select the counter mode.
These bits are not synchronized.
Value Name Description
0x0 COUNT16 Counter in 16-bit mode
0x1 COUNT8 Counter in 8-bit mode
0x2 COUNT32 Counter in 32-bit mode
0x3 - Reserved

The code

0x2 << TC_CTRLA_MODE_Pos

selects "COUNT32 Counter in 32-bit mode" by setting Bit 1 of the Timer Counter Mode Bits

 

Edit: OP is correct there is a bug and should be reported as such.

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Mon. Jan 15, 2018 - 11:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OP note my edit above.  Missing a bit in the bucket.

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Mon. Jan 15, 2018 - 11:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Testing indicates that the COMPONENT SETTINGS Mode: drop down menu selections are ignored as the same code is produced for all of the counter modes ( 8, 16 and 32 Bit).

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Tue. Jan 16, 2018 - 01:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi. Please create a microchip support ticket on this...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

I am opening one now to address what I found in post #6 above.  This will cover the OP bug report as well.

 

Edit: Support case number is 00271476

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Tue. Jan 16, 2018 - 01:05 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are right, I forget to say that bug happens for all mode but 32 bits counter (0x02 mode) although I'm interested in 8 bits counter mode.

 

How can I follow bug resolution, I've tried to find in microchip website for support case number 00271476

 

Thank you for your time!

 

regards

 

 

 

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

charlie_tango wrote:
How can I follow bug resolution, I've tried to find in microchip website for support case number 00271476

Support cases are associated to the customer account on Microchip Support, so it looks like I am the only one that can track it.

 

I filed the case with an Urgency of Critical and it is already marked as In Progress.  I will post updates here as I receive them to keep you in the loop.

 

You are welcome, thanks for finding the bug!

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

Received two responses from support;

Thanks for contacting Microchip Technical Support Team.

The Atmel Start driver part should take MODE as a input from front end. But current driver is not supported for this.
This is confirmed as a bug and we understand the priority of this issue. We have reported this issue to our internal team.
This will be fixed in the future.

Thanks for reporting this issue to us. 

Proposed Resolution

Issue has been identified in Lite TC driver. We have reported this issue to our internal team. This will be fixed in the future.

Thanks for reporting this issue.

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

Thank you Larry,

 

Basically, Microchip has said: May be in the future! as my wife said ;-)

 

I hope Microchip has in mind a little few weeks for "Future".

 

regards

 

p.s. Could it be because it's a Atmel product?

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

Latest news from support;

 

***** AUTOMATED MESSAGE - DO NOT RESPOND *****

 

Hello Larry,

 

There has been no communication on your case 00271476 for more than 14 days after we proposed a resolution, and the case has therefore been closed. Please open a new support case if you have further request about our products.

 

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius