Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/30/07 14:20
Read: times


 
#138290 - Very stubborn UARTs...
I know I'm doing something wrong, because the accursed chip (still Dallas DS89C450) simply will not send a character.

I know the real-world wiring is right, and that the UART isn't fried, because I program it via a serial port. The chip autobauds in that case, though, so that's no help.

I know that it's executing code because I've rigged some blinkenlights to serve as very primitive breakpoint indicators.

I think I know that it's not sending a character because a trial serial port sniffer shows nothing. I know the sniffer works because I can watch the chip being programmed.

I've tried loading a debugger, but it communicates using the UART that I've set up, and the Keil IDE doesn't see any response. I have a demo board (I think with JTAG) on order, but that's not due for a few more days.

The only thing I can think of that's possibly incorrect is the UART initialization code and/or the application code, as follows:
void initSerialPorts(void){
	TMOD |=0x20;//put timer 1 into mode 2
	TH1=247;//value to set timer to after it rolls over
	TL1=247;
	TR1=1;//start timer 1 running
	PCON |= 0x80;//double clock for UART0
	TB8_0=0;//9th data bit
	SCON0= 0x50;//put serial port 0 into mode 1 and enable receive interrupt
	ES0=1;//enable serial port interrupts
	EA=1;//enable interrupts
	return;
}

main()
{
	unsigned char x=0x01;
	P1&=0xFE;//complete green LED circuit
	initSerialPorts();
	P1&=0xF7;//light red LED
	SBUF0=0x41;
	while(1){;}
}


Just to make things that much weirder, it doesn't seem to be returning from the call to initSerialPorts(), i.e. the red LED doesn't come on. However, this problem existed even when functions did return successfully. My best guess is that the micro ran out of stack space, but I can't for the life of me figure out how -- there's hardly anything using it.

Advice on either of these problems would be very welcome.

Many Thanks,
Bob Robertson.

Datasheet: http://datasheets.maxim-ic.com/en/ds/DS8...89C450.pdf

User Guide: http://www.keil.com/dd/docs/d...420_ug.pdf

List of 43 messages in thread
TopicAuthorDate
Very stubborn UARTs...            01/01/70 00:00      
   Keil gives error on your construct            01/01/70 00:00      
      Re: error            01/01/70 00:00      
         a guess            01/01/70 00:00      
            Re: guess            01/01/70 00:00      
               humm humm            01/01/70 00:00      
                  re: humming            01/01/70 00:00      
   PS            01/01/70 00:00      
      have you tried the simulator?            01/01/70 00:00      
         Re: LED            01/01/70 00:00      
            HUH???            01/01/70 00:00      
               again a HLL habit, isn't it...            01/01/70 00:00      
            2 possibilities            01/01/70 00:00      
               Whoops.            01/01/70 00:00      
               Dummy Interupt            01/01/70 00:00      
                  agreed, I do it like this            01/01/70 00:00      
                     Niiice            01/01/70 00:00      
   you could solve a lot of problems if....            01/01/70 00:00      
      Thanks, but...            01/01/70 00:00      
   Back to square one?            01/01/70 00:00      
      blinkenlight            01/01/70 00:00      
         Get a \'scope!            01/01/70 00:00      
         More hints            01/01/70 00:00      
         Re: hints            01/01/70 00:00      
            I am sure it is published            01/01/70 00:00      
   Gah.            01/01/70 00:00      
      read the right spec            01/01/70 00:00      
         specs            01/01/70 00:00      
            Not a spec            01/01/70 00:00      
               why not?            01/01/70 00:00      
                  Proviso            01/01/70 00:00      
                     just a small remark            01/01/70 00:00      
            oh, yes, you can            01/01/70 00:00      
   Huzzah!            01/01/70 00:00      
      value of KISS            01/01/70 00:00      
      I find that hard to beleive!            01/01/70 00:00      
         Okay, so            01/01/70 00:00      
            I thotoughly agree with you there!            01/01/70 00:00      
            Further details            01/01/70 00:00      
      You\'re not finished yet            01/01/70 00:00      
         Lessons            01/01/70 00:00      
            \"does have it all\" is of no good            01/01/70 00:00      
            Thanks for the update            01/01/70 00:00      

Back to Subject List