MC9S12E256 SCI reading problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S12E256 SCI reading problem

445 Views
Ingo_Michael
Contributor II

According to my last post down below, I figured out, my gsm module was in "command echo moode" (ATE).

I swiched it off with the command "ATE0"

Now, all work as expected.

 

With echo enabled "ATE1"

 

168232_168232.pngpastedImage_1.png

 

Without echo enabled "ATE0"

168245_168245.pngpastedImage_2.png

 

 

Hello experts,

 

I wrote a simple Programm to send the string "ATT" to a gsm modem. The modem answer should then be "OK CR LF".

 

Can anyone tell me why I see in the SCI0DRL Register a value of 54 and in the A Register a value of 41? (These are all HEX values, exept my ARRAY is in Symbolic view)

Why I getting the char "A" back from my modem instead of a "O"?

How can I clear the SCI0DRL Register after sending a Byte to my modem?

I am really confused....

 

 

168231_168231.pngpastedImage_2.png

 

Does anyone have an idea?

 

BR

 

Ingo

Labels (1)
0 Kudos
1 Reply

288 Views
iggi
NXP Employee
NXP Employee

Hi Ingo,

Did you follow these steps to initiate an SCI transmission?


1. Configure the SCI:
    a)  Select a baud rate. Write this value to the SCI baud registers (SCIBDH/L) to begin the baud
         rate generator. Remember that the baud rate generator is disabled when the baud rate is 0.
         Writing to the SCIBDH has no effect without also writing to SCIBDL.
   b)   Write to SCICR1 to configure word length, parity, and other configuration bits (LOOPS,
         RSRC, M, WAKE, ILT, PE, and PT).
   c)   Enable the transmitter, interrupts, receive, and wake up as required, by writing to the SCICR2
         register bits (TIE, TCIE, RIE, ILIE, TE, RE, RWU, and SBK). A preamble or idle character
         will now be shifted out of the transmitter shift register.

2. Transmit procedure for each byte:
   a)   Poll the TDRE flag by reading the SCISR1 or responding to the TDRE interrupt. Keep in mind
          that the TDRE bit resets to 1.
   b)    If the TDRE flag is set, write the data to be transmitted to SCIDRH/L, where the ninth bit is
          written to the T8 bit in SCIDRH if the SCI is in 9-bit data format. A new transmission will not
          result until the TDRE flag has been cleared.
3. Repeat step 2 for each subsequent transmission

Regards,

iggi

0 Kudos