After a few more tests, ANSEL and CMCON don't affect the PIC's behaviour.

The key seems to be the oscillator OSCON setting.

Before I got your help, I was using an external 20Mhz ceramic resonator. Nothing worked.

I changed to the internal oscillator with default settings = 31,25kHz. Nothing worked either.

To make it work, I set the oscillator to 4MHz as suggested by Mister_e.

I also tried all the other possible internal oscillator (IRCF) settings; apparently, only 4MHz is working.

I read the PBP help file under the SEROUT2 command. Nothing specifies that serial communication is working only with 4MHz.

I'm not using the USART functionality of this PIC. Is there any info I'm missing somewhere else?