I have fixed the registers to what they should be, I was just trying to implement a simple SCI at this point.
void main (void) {
SCIBDH = 0x00;
SCIBDL = 0x34; //baud of 9600
SCICR1 = 0x00; //8 bits, no parity */
SCICR2 = 0x0C; //Enable transmitter and receiver
// Transmission
while(1) {
SCIDRL = 0x29; //send the bit sequence
while ((SCISR1 & 0x80) == 0) ; // Wait for transmission buffer to be empty(TDRE)
// Reception
while ((SCISR1 & 0x20) == 0) ; /* Wait for received sequence */
if ((SCISR1 & 0x0F) != 0)
{
PORTA=1;
PORTB=0;
}
}
The HCS12_Serial_Monitor PRM linker file is:
/* This is a linker parameter file for the MC9S12C32 */
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
SEGMENTS /* here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
RAM = READ_WRITE 0x3800 TO 0x3FFF;
/* unbanked FLASH ROM */
ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF;
ROM_C000 = READ_ONLY 0xC000 TO 0xF77F;
/* banked FLASH ROM */
/* PAGE_3E = READ_ONLY 0x3E8000 TO 0x3EBFFF; not used: equivalent to ROM_4000 */
/* PAGE_3F = READ_ONLY 0x3F8000 TO 0x3FBFFF; not used: equivalent to ROM_C000 */
//OSVECTORS = READ_ONLY 0xFF8A TO 0xFFFF; /* OSEK interrupt vectors (use your vector.o) */
END
PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */
_PRESTART, /* Used in HIWARE format: jump to _Startup at the code start */
STARTUP, /* startup data structures */
ROM_VAR, /* constant variables */
STRINGS, /* string literals */
VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */
//.ostext, /* OSEK */
NON_BANKED, /* runtime routines which must not be banked */
DEFAULT_ROM,
COPY /* copy down information: how to initialize variables */
/* in case you want to use ROM_4000 here as well, make sure
that all files (incl. library files) are compiled with the
option: -OnB=b */
INTO ROM_C000/*, ROM_4000*/;
//.stackstart, /* eventually used for OSEK kernel awareness: Main-Stack Start */
SSTACK, /* allocate stack first to avoid overwriting variables on overflow */
//.stackend, /* eventually used for OSEK kernel awareness: Main-Stack End */
DEFAULT_RAM INTO RAM;
//.vectors INTO OSVECTORS; /* OSEK */
END
ENTRIES /* keep the following unreferenced variables */
/* OSEK: always allocate the vector table and all dependent objects */
//_vectab OsBuildNumber _OsOrtiStackStart _OsOrtiStart
END
STACKSIZE 0x100
VECTOR 0 _Startup /* reset vector: this is the default entry point for a C/C++ application. */
//VECTOR 0 Entry /* reset vector: this is the default entry point for an Assembly application. */
//INIT Entry /* for assembly applications: that this is as well the initialization entry point */
I have unplugged the serial cable that is coming from the computer but there is still a transmission coming to the microcontroller via pin 7 in the bottom of the microcontroller.