??? 04/30/07 15:51 Read: times |
#138315 - Whoops. Responding to: ???'s previous message |
Sorry, it just toggles a bit. Sloppy thinking on my part.
Complete source code is as follows; #include <DS89C4xx.h> void initSerialPorts(void){ TMOD =0x20;//put timer 1 into mode 2 TH1=247;//value to set timer to after it rolls over TL1=247; EWDI=0;//disable the watchdog interrupt 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; P1&=0xF7;//light red LED } void serial1Service(void) interrupt 4{ if(RI_0==1){ RI_0=0; } if(TI_0==1){ TI_0=0; } } main() { unsigned char x=0x01; P1&=0xFE;//complete green LED circuit initSerialPorts(); SBUF0=0x41; while(1); } The variant I'm using has 256 bytes of on-chip RAM; I didn't think that there's enough going on to corrupt the stack. The simulator's perfectly happy. Thanks again, Bob Robertson. |
Topic | Author | Date |
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 |