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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/10/02 02:08
Read: times


 
#19619 - RE: HELP ME........
Had to make the following changes in order for your code to run under Pinnacle. I'm not quite sure what you are doing with SCON. Setting it to #7Ah gives you the following:
7A = 0111 1010

Bit 7&6
01 = Mode 1 8-bit UART Variable baud rate
bit 5
1 = Multiprocessor comm feature
bit 4
1 = Enable Reception
bit 3
1 = 9th transmit bit for Modes 2 & 3
bit 2
0 = RB8 = 0
bit 1
1 = Transmit Interrupt flag set
bit 0
0 = Receive interrupt flag not set

I moved CLR TI to the beginning of the Interrupt routine. Also relocated MOV A,#20h before the Interrupt enable instruction, otherwise the first interrupt prevents loading ACC with data. I think loading 00h to SBUF will not result in a transmit. If I am wrong I hope someone will clarify.

Your code which runs successfully on Pinnacle:

ORG 00h
LJMP MAIN
ORG 0023H
LJMP SPISR
ORG 0030H
MAIN: MOV SCON,#7AH
MOV IP,#038H
MOV TMOD,#20H ; TIMER 1 MODE2
MOV TH1,#0FDH ; 9600 BAUD RATE
SETB TR1
MOV A,#20H ;moved this line here
MOV IE,#90H
SJMP $
SPISR: CLR TI ;moved this line
PUSH PSW
CJNE A,#7FH,SKIP
MOV A,#20H
SKIP: MOV SBUF,A
INC A
POP PSW
RETI
END

Also, in a response to another earlier posting Erik stated in very strong terms that any unused interrupt vectors should have a RETI at that location. I heartily (and humbly) endorse his suggestion. I'm sure we all have horror stories of unexpected interrupts vectoring into the Enchanted Forest, never to return.

Hope this helps,

Hal


List of 68 messages in thread
TopicAuthorDate
HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: In summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: In summary            01/01/70 00:00      
RE: In summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: In summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: MSN / ICQ            01/01/70 00:00      
RE: MSN / ICQ            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
the problem is same            01/01/70 00:00      
more            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: the problem is same            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
What happened with......            01/01/70 00:00      
RE: this is no 50 !            01/01/70 00:00      
RE: this is no 50 !            01/01/70 00:00      
RE: What happened with......            01/01/70 00:00      
RE: What happened with......            01/01/70 00:00      
RE: What happened with......            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
We are keeping going.....            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
need help programming uart and adc in c            01/01/70 00:00      
Hi guys I here again            01/01/70 00:00      
RE: Hi guys I here again            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
It's working guys.........            01/01/70 00:00      

Back to Subject List