USART RX interrupts [solved: missed sei()]

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

Trying to get USART going.

I can see data in the DATA reg if I poll it and the RXCIF bit getting set in STATUS, but my ISR is not getting called.

I have set the RX int to low level and enabled low level int in PMIC.

Anything else I need to do???

USARTC0.CTRLC = USART_CHSIZE_8BIT_gc; //no partiy, 1 stop, 8 data bits
USARTC0.BAUDCTRLA = 12; //12 = 4800 with 2meg clock, clk2X set to zero and BScale set to 0
USARTC0.BAUDCTRLB = 0;
USARTC0.CTRLA = USART_RXCINTLVL_LO_gc; //rx ints only
USARTC0.CTRLB = USART_RXEN_bm; // rx enable
PMIC.CTRL = PMIC_LOLVLEN_bm; //Enable low level

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

I knew that posting that would solve the problem!
Global Interrupt Enable!

sei();

Works fine now...

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

can you tell me how did you set your PORTC? I'm having trouble with receiving data... can send it OK, but can't receive, and interrupt doesn't get triggered :/