Split from: Atxmega128A1 VS ATxmega128A1U

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

How my software can detect on which MCU it is executed ?

ATXmega128A1   DEVID=1Eh, 97h, 4Ch

ATXmega128A1U DEVID=1Eh, 97h, 4Ch

They have the same DEVID.

How my software can differentiate these chips ? 
 

Last Edited: Tue. Apr 14, 2015 - 05:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

One "hacky" way is to write something into USB register and see if it stays there.

 

Also, Atxmega128A1 is not recommended for new designs.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

hey,

 

Most of the times. A #define is used to do that stuff.

I don't know for sure if there is the code will have a difference in the ATXmega128A1 and the ATXmega128A1U.

 

If it has, it should be like:

#if define ATXmega128A1
    DEVID = 1EH,97H,4Ch;
#endif

#if define ATXmega128A1U
    DEVID = 1E,97H,4CH;
#endif
//OR
#ifdef ATXmega128A1
    DEVID = 1EH,97H,4CH;
#endif

#ifdef ATXmega128A1U
    DEVID = 1EH,97H,4CH;
#endif
Last Edited: Tue. Apr 14, 2015 - 06:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rgamer145 wrote:
Most of the times. A #define is used to do that stuff.

Depends what you mean by, "that stuff"

 

  • A #define can only do compile-time stuff - to generate code for either the A1 or the A1U variant;
     
  • it sounds like the OP wants to do this at run-time - to generate common code for both the A1 and the A1U variant.

 

Ale3000 - please clarify!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MCU.REVID >= 'L'?

Last Edited: Tue. Apr 14, 2015 - 12:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

 

Ale3000 - please clarify!

I want to detect in run-time.

We have many old devices with A1.

New devices are producing with A1U.

 

A1 has no CRC16 module,

A1U has CRC16 module.

 

I want to realize such function :

if( A1U) CalcHardwareCRC();

else CalcSoftwareCRC();

 

ezharkov wrote:

MCU.REVID >= 'L'?

I think, this will help me. Thanks.

Спасибо. Позже попробую.

Last Edited: Fri. Apr 24, 2015 - 05:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Answer could be in your question.

 

You can try feeding couple of bytes into CRC engine, then compare result register with precalculated value.

With A1 chip I would expect 0x0000 or 0xFFFF instead of meaningfull value.

Last Edited: Sat. Apr 25, 2015 - 09:51 PM