Currently, I am trying to interface the a cs8900a to the motorola 6812 microcontroller. A desecription and schematic of the board I am using can be found at
Motorola ports - IET 8900a pins
PORTT[7:0] - AD[7:0] PORTJ[7:4] - D[3:0] PORTJ[0] - AEN PORTJ[1] - IOR PORTJ[2] - IOW
#include "HC12.h" //port maps
#define PPPtr 0x0a //address of packet page pointer #define PPData 0x0c //address of packet page data register #define RxTxData 0x00 // Receive/Transmit data (port 0) #define RxTxData1 0x02 // Receive/Transmit data (port 1) #define TxCmd 0x04 // Transmit Command #define TxLength 0x06 // Transmit Length #define ISQ 0x08 // Interrupt status queue #define bkpt asm("bgnd");
//waits a time/4 ms void mswait(unsigned short time){
for(;time>0;time--){
TC5=TCNT+2000; // wait
TFLG1 = 0x20; // clear C5F
while((TFLG1&0x20)==0){}; } }
void TimerInit(void){
COPCTL = 0x00; // disable COP TIOS |= 0x20; // enable OC5 TSCR =0x80; // TEN(enable)
}//changing the wait periods does not change the final data output unsigned char IOread (unsigned char address) { unsigned char data; DDRT = 0x00; //set port t as input PORTJ = ((address