TWIE on ATXMEGA128D3

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

Does anyone uses the two-wire interface E on the ATXMEGA128D3? I'm having some strange issues with it. Well, in fact, I'm not being able to use it at all. Here's the problem:

The ATXMEGA128D3 datasheet and Atmel website says it has 2 Two-Wire Interfaces: TWIC and TWIE.

The datasheet (page 51 - Peripheral Module Address Map) shows the address for both TWIC (0x0480) and TWIE (0x04A0). But the manual only mentions TWIC, both on the address map and on the processor layout. Also, the ATxmega128D3def.inc file only includes the TWIC, and not the TWIE.

Well, so I add the addresses for TWIE myself (just add 32 to the TWIC addresses) and try to use TWIE, but it just gives no response at all. Even when I simply initialize it, the I/O pins continue to be able to be used as regular I/O's, which should not happen, and does not happen when I try it with the working TWIC.

So my question is: Does the ATXMEGA128D3 have a TWIE at all? And if so, is it's right base-address 0x04A0? And if so as well, is there any trick to get it to work?

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

Nevermind... I just read the errata and the TWIE doesn't work on ATxmega128D3. Beats me how they release a chip like that, and even today they still announce on their website that it has 2 Two-wire ports.

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

The new "U" versions of the existing chips have a lot of the previous silicon faults fixed. So if there is a 128D3U then it could be that there is no problem with TWIE there.

EDIT OK it seems there are only U versions of A3 and A4's so forget that as an idea.

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

If you tried to use TWIC, you might also think it was broken. The problem with TWIC is that the include file iox128d3.h has the wrong values for the master port addresses.  The following lines:

 

#define TWIC_MASTER_CTRLA _SFR_MEM8(0x0482)

#define TWIC_MASTER_CTRLB _SFR_MEM8(0x0483)

#define TWIC_MASTER_CTRLC _SFR_MEM8(0x0484)

#define TWIC_MASTER_STATUS _SFR_MEM8(0x0485)

#define TWIC_MASTER_BAUD _SFR_MEM8(0x0486)

#define TWIC_MASTER_ADDR _SFR_MEM8(0x0487)

#define TWIC_MASTER_DATA _SFR_MEM8(0x0488)

 

should really be:

 

#define TWIC_MASTER_CTRLA _SFR_MEM8(0x0481)

#define TWIC_MASTER_CTRLB _SFR_MEM8(0x0482)

#define TWIC_MASTER_CTRLC _SFR_MEM8(0x0483)

#define TWIC_MASTER_STATUS _SFR_MEM8(0x0484)

#define TWIC_MASTER_BAUD _SFR_MEM8(0x0485)

#define TWIC_MASTER_ADDR _SFR_MEM8(0x0486)

#define TWIC_MASTER_DATA _SFR_MEM8(0x0487)

 

Note that revision J of the ATxmega128D3 has the TWIE port fixed.