cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 communication between st72f264 and PC

mailtoarup
Associate II
Posted on April 26, 2004 at 13:56

RS232 communication between st72f264 and PC

2 REPLIES 2
mailtoarup
Associate II
Posted on April 23, 2004 at 07:09

sir ,

I was running the program as per the example program on SCI given on the website.

I was using the Indart-st72FNow Clock coming to OSC1 pin of my microcontroller on board is 6.41MHz.so f(cpu) =3.31MHz(approx).

As per the details,My SCIBRR=$64

Tx=fcpu/16*PR*TR

PR=3

TR=16

so,Tx= 4179 baudrate

I have configure my Hyper terminal .There i set baudrate=4800

Now When ever I wrote 41(A or a)and 61(A or a) in..decimal,

it should show A and a in my Pc Hyper Terminal program.

But it is showing some other graphical character.It is communicating i believe but not as per the value i have given.Pls tell me how to test this.As of now i am using only TRANSMISSION mode.i have attached the sample code.Pls look into that.

One more thing whenever i check my SCIDR register(0x0051 location)

i found it to be 70 always.

And Default value in SCISR register is c0.i.e TDRE & TC is 1.

As per datasheet TDRE bit will be 1 whenever data of TDR is shifted to Shift rgister i.e data has been transferred.

And TDRE bit will be clr if we read the SCISR and SCIDR register.

But while program is running it is always'' 1''and TC is also remain1.

I am debugging in step by step mode.But it's value is 1.

Pls help in solving the problem.Why in my program Those register is not working properly.

hoping to get a kind help

*********I am attaching my sample code

Thanks,

Arup

________________

Attachments :

rs232.asm : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Ah&d=%2Fa%2F0X0000000bUj%2FHaElAofRBopf19TAxpc4dHvatcw2FL4JslCvnaB0X2A&asPdf=false
jatin
Associate II
Posted on April 26, 2004 at 13:56

Please check your cpu clock on MCO pin. There is a baud rate mismatch between the transmitter and the receiver. You can also check the bit time on the TDO pin.

Once the baud rate matches, for printing the 'a' and 'A' characters you have to send 0x41 , 0x61 respectively.