xMega in the Simulator

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

When you're simulating an xMegaD3 part in the simulator, and you execute an instruction like

Clrb(LCD_BL_PRTC,LCD_BL_PIN);

where Clrb is defined...

#define LCD_BL_DPRT		PORTE.DIR
#define LCD_BL_PRTS		PORTE
#define LCD_BL_PRTC		PORTE
#define LCD_BL_PIN		0

#define Clrb(port,bitnum)	port.OUTCLR = (1<<bitnum)

Where, in the output winder do you look to see what you've actually done to the pin?

I'm trying to adapt a ELT240320TP library written for ATMega to an xMega part, but whenever the library is trying to draw something, it flashes the backlight rapidly on and off, so I figure it's twiddling the wrong bit somewheres.

Attachment(s): 

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

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

Ah! And I have found my boneheaded mistake! I was writing the data to port E, which contains the control pins, not port C which is connected to the data pins.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut.