Problem with serial port F

I designed a board with the RCM4010 that needs to use serial ports B,C,D, and F. But as soon as I try to enable port F (on PE2 and PE3) the debugger hangs. I used IOCONFIG to make a file. Here is all the code, with the library pasted in for simplicity. It only opens portd B and F. It hangs after executing the line marked with “***”. Any ideas?

void BoardInit();
void ClockCheck();
void SetupSerial();
#define BINBUFSIZE 31
#define BOUTBUFSIZE 31
#define SERB_TXPORT PCDR
#define BDRIVE_TXD 4
#define SERB_RXPORT PCDR
#define BDRIVE_RXD 5
#define FINBUFSIZE 31
#define FOUTBUFSIZE 31
#define SERF_TXPORT PEDR
#define FDRIVE_TXD 2
#define SERF_RXPORT PEDR
#define FDRIVE_RXD 3

void ClockCheck()
{
if (freq_divider != 96) // 29.49 MHz, doubled
{
exception(-ERR_LIBCLOCKSPEED);
}
}

void SetupSerial()
{
serBopen(9600L);
serFopen(9600L);
WrPortI(SFCR,&SFCRShadow, 0x21);
}

void BoardInit()
{
ClockCheck();
// The following differ from BIOS settings
SetupSerial();
WrPortI(PCALR,&PCALRShadow,0x30); // Serial Port F
WrPortI(PCFR,&PCFRShadow,0x50); // Serial Port F
WrPortI(PEALR,&PEALRShadow,0x30); // Serial Port F
WrPortI(PEDDR,&PEDDRShadow,0x04); // Serial Port F

// *** this is the line that causes the problem
WrPortI(PEFR,&PEFRShadow,0x04); // Serial Port F
// *** never gets here

WrPortI(SCCR,&SCCRShadow,0x30); // Port E Input and output Pins
}

int main()
{
printf("here 1
");
BoardInit();
printf("here2
");
serBwrite("Hello B
",9);
printf("here 3
");
return 0;
}

did you ever find a solution here ?

My problem is with the RCM5000 port F

I can Tx data…
but the RX does not work…

Yes I did. The problem was that the IOCONFIG program generates bogus code. Some of the WrPortI calls needed to be converted so that they retained some of the other bits (ie, read, mask, set bits, write).

Like this:


WrPortI(PEALR,&PEALRShadow,PEALRShadow | 0x30);
WrPortI(PEDDR,&PEDDRShadow,(PEDDRShadow &0xF7) | 0x04);
WrPortI(PEFR,&PEFRShadow,PEFRShadow | 0x04);

Jim

thanks jim…

mine was a bit different…

David at Rabbit helped…

This is for the RCM5000 processor
for PORT F RxF pin to work you need to add this line of code

#define SERF_RXPORT PDDR

I suspect the same would be needed if you were using
PORT RxE