AnsweredAssumed Answered

k60 UART Interrupts

Question asked by Ken Armitage on Oct 13, 2014
Latest reply on Oct 21, 2014 by Ken Armitage

Hi everyone

 

I'm using CW10.6 and MQX4.1 and developing an application with the K60 on a TWSK60 tower assembly.

 

I have connected a TFT display which has a serial port (just TX/RX) which I'm driving through UART4 (ttye:) on the K60 board. The commands for the display are sent as "printf" string commands.

 

For example;

 

void *fh_ptr;

fh_ptr = (void *)fopen("ttye:", BSP_DEFAULT_IO_OPEN_MODE);

if (fh_ptr == NULL) {

printf("Cannot open the interface to the display\n"); /* prints on default IO port */

_task_block();

} /* ttye port available */

_io_set_handle(IO_STDOUT, fh_ptr);

printf("FRAME 10 10 300 204 5 0 %d\n",ORANGE); /*draws a frame on the display at coordinates 10 10 */

 

Every was going nicely until I needed to receive some data from the display (it has a touch screen capability and sends characters down the serial port to indicate coordinates etc) so thought I would just reconfigure the ttye: port to be an interrupt driven one by making the change to the config.h file and enabling the ittye: instead of ttye:

 

I'm sure there are some other changes I need to make like adding some form of interrupt service routine to deal with characters received from the display, but I'm really struggling to find either examples or sufficiently clear words in the documentation. On top of that, the printf commands no longer consistently get through to the display

 

Can anyone help me please...?

 

Ken

Outcomes