Hello ALL,
I thank you all for your replies ...
OK, now, I'll explain the problem in more details ..
I'm attaching few lines of the UART intialization as received from a team member ..
We use an old microcontroller Motorola MC68k, with the MC68681 UART with 9600 Baudrate.. probably most of you might not be familiar with it, hence I'm going to write what each line does..
Firmware:
---------
START ORG $400400
DUART EQU $A00001
MR1A EQU DUART+0 *Mode Register Port A
MR2A EQU DUART+0 *Mode Register Port A
SRA EQU DUART+2 *Status Register Port A (read only).
CSRA EQU DUART+2 *Clock Select Register Port A (write only)
CRA EQU DUART+4 *Commands Register Port A (write only)
TRBA EQU DUART+6 *Receiver Buffer Port A (read only)
TBA EQU DUART+6 *Transmitter Buffer Port A (write only)
ACR EQU DUART+8 *Auxiliary Control Register
*************************************
* INTIALIZE PORT A FOR TRANSMITTING
*************************************
SETPA MOVE.B #$10,CRA * Reset Mode register pointer to MR1
MOVE.B #$80,ACR * Sets the Auxiliary Register to baud rates Set2 (includes the 9600 baudrate)
MOVE.B #$BB,CSRA * Set to 9600 Baud
MOVE.B #$93,MR1A * Setting Mode Register to 8-Bit , No Parity, RxRTS_Control Enabled, Block Error Mode, RxIRQ =RxRDY
MOVE.B #$37,MR2A * Normal Operation Mode, 1 Stop Bit, Tx RTS Control Enabled, CTS Enables Transmitter=Enabled
MOVE.B #$05,CRA * Enables Tx & Rx on Port A for operation
NOP * Wait
REPEAT MOVE.B #$41,TBA * Send the ASCII for the "A" character to the transmit register
BRA REPEAT * repeat forever just for testing purposes
NOTE: The ready-to-send, and clear-to-send wires are connected directly together ..
Visual Basic Code:
------------------
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 500
MSComm1.CommPort = 1
MSComm1.Settings = "9600,n,8,1"
If MSComm1.PortOpen <> True Then MSComm1.PortOpen = True
End Sub
Private Sub Timer1_Timer()
Text1.Text = MSComm1.Input
End Sub
I'm suspecting something to be wrong with the transmitting microcontroller coding, which I couldn't figure out what it would be, probably with handshaking signals. The case i'm facing is that: when I run my VB program, I get a stream of "PPPPP" (instead of "AAAA"), if I close, and run again I get a different stream sometimes it's "AAAA", other times it's "TTTTT" or "******".
echo47 .. thanx for ur reply, you have a point .. we have to try your suggestion, and get back to you..
anyways.. here's the problem with more details, I thank you again for your replies, and more suggestions are welcomed
cheeerz,
AYOUB