go_away

Author Topic: trouble with tx/rx code on an HC08  (Read 511 times)

0 Members and 1 Guest are viewing this topic.

Offline kraeteTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
trouble with tx/rx code on an HC08
« on: December 31, 2011, 08:00:56 PM »
Im trying to program the SCI tx/rx a pair of HC08's... i think the one that transmits is working find but i cant get the receiver to work... i dunno i feel kind of beyond my skill level. if anyone could look at this code and give me a pointer id appreciate it.


im just gonna post the important stuff, ive already initialized everything and set up baud rates

Master
  SCI_write_slave(0); //write a 0 from master to slave
while (PTAD==0x27){
   SCI_write_slave(1); //write a 1 from master to slave
}

void SCI_write_slave(char i){
SCIC2 = 0x08;  //turn on transmit
SCID=i;
while(!(SCIS1&0x40));
return;


Slave

i=SCIS1
SCIC2=0x04
while(!(SCIS1&0x20));
i=SCID


so im monitoring i and it should hop between 0 and 1 when i push a button, but all it does is give a "trigger a & b" error and resets

 


Get Your Ad Here

data_list