Author Topic: MC9S12NE64 SCI port and Interrupts  (Read 25134 times)

Offline charlatan_81

  • Newbie
  • *
  • Posts: 3
    • View Profile
MC9S12NE64 SCI port and Interrupts
« on: March 26, 2009, 05:47:12 AM »
Hello,
I'm using the neCore to recieve and sort ID numbers(in ASCII) from a RFID reader. I've initialized ports and used interrupts before in assembly but not in C. Also, I was wondering how uTasker deals with interrupts, I found the SCI 1 interrupt but I'm not sure on how to use it.
Any help will be greatly appriciated.
Regards,
M Koleed

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: MC9S12NE64 SCI port and Interrupts
« Reply #1 on: March 26, 2009, 01:37:14 PM »
Hi

If you use the standard serial interface routines you will not need to be involved with how the interrupts are use - this is embedded in the driver.

See the following thread for details on how to use the UARTs: http://www.utasker.com/forum/index.php?topic=54.msg220#msg220

Regards

Mark




Offline charlatan_81

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: MC9S12NE64 SCI port and Interrupts
« Reply #2 on: March 31, 2009, 11:10:19 AM »
Hi Mark,
Thanks for the reply.
I read the thread and reread the uTaskerDrivers document that came with uTasker and I'm still having difficulties.
I tried setting the QUEUE_HANDLE configurations in application.c but the SCI didn't work. Also, I tried copying the SCI example in the uTaskerDrivers document in application with no luck and into my own program and again with no luck.
Can you please tell me how to configure and enable SCI1 and set set the message length for MSG_MODE?
Thanks

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: MC9S12NE64 SCI port and Interrupts
« Reply #3 on: March 31, 2009, 12:34:27 PM »
Hi

The use of the UART on the NE64 is no different than on any other processor. Therefore the guide that you read should be suitable.

#define DEMO_UART        1  // this sets SCI1 as debug input/output.

I wouldn't try changing to message mode until you have proven that the standard character mode operates correctly. As long as SERIAL_INTERFACE is defined the UART driver will be active and the demo menu should be operational on SCI1.

After that you can activate message mode by setting the flag when opening the serial interface: tInterfaceParameters.usConfig |= (MSG_MODE);

Note that message mode is a reception mode (it will collect reception until a terminator is received rather than informing of each received character). The length option is activated by adding the appropriate flag: tInterfaceParameters.usConfig |= (MSG_MODE_RX_CNT);

In this case the receiver first reads the message length from the queue and then the message data content.

These cases are discussed in the other thread and examples are in application.c (TEST_MSG_MODE and TEST_MSG_CNT_MODE).

Note that defines SUPPORT_MSG_MODE and SUPPORT_MSG_CNT are also required for the corresponding driver support to be activated.

Finally note that the NE64 has very little SRAM and the UART buffers required to support the interface (lengths TX_BUFFER_SIZE and RX_BUFFER_SIZE) may have to be chosen carefully to avoid running out of memory. Alternatively other resources may have to be deactivated.

Regards

Mark


Offline Mike

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: MC9S12NE64 SCI port and Interrupts
« Reply #4 on: May 13, 2009, 09:52:01 AM »
Hi Mark,
I'm fairly new to uTasker. I've got my own program to work and UDP connection going. I've read through the documents and this forum topic and I'm still having trouble getting the SCI to work(for example, whether to add or change codes in my own program or in the header/c files).
I know this is an annoying question, but can you please tell me step by step how to initialize and gather the information from the SCI?
Thanks,
Mike

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: MC9S12NE64 SCI port and Interrupts
« Reply #5 on: May 13, 2009, 11:25:02 AM »
Hi Mike

You should find all information in the following sources:
General thread on UART (SCI) use: http://www.utasker.com/forum/index.php?topic=54.0
Document (in progress): http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.PDF

Good luck


Regards

Mark