Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sefai

Pages: [1]
1
NXPTM M522XX, KINETIS and i.MX RT / Re: Porting Code to M5229
« on: September 29, 2009, 07:18:09 PM »
Mark I have read that one and the other threads of Neil. This is what I do:

Code: [Select]

void PP_OpenComm(void)
{
TTYTABLE tInterfaceParameters;                                       // table for passing information to driver

tInterfaceParameters.Channel = 0x02;                                    // set UART channel for serial use
    tInterfaceParameters.ucSpeed = SERIAL_BAUD_9600;                     // baud rate
    tInterfaceParameters.Rx_tx_sizes.RxQueueSize = RX_BUFFER_SIZE;       // input buffer size
    tInterfaceParameters.Rx_tx_sizes.TxQueueSize = TX_BUFFER_SIZE;       // output buffer size
    tInterfaceParameters.Task_to_wake = TASK_PP_RECEIVE;                    // wake self when messages have been received
    #ifdef SUPPORT_FLOW_HIGH_LOW
    tInterfaceParameters.ucFlowHighWater = 80;// set the flow control high and low water levels in %
    tInterfaceParameters.ucFlowLowWater = 20;
    #endif
    tInterfaceParameters.Config = (CHAR_8 + NO_PARITY + ONE_STOP + CHAR_MODE + RTS_CTS);
    tInterfaceParameters.Config |= INFORM_ON_FRAME_TRANSMISSION;
    #ifdef TEST_MSG_MODE
        tInterfaceParameters.usConfig |= (MSG_MODE);
        #if defined (TEST_MSG_CNT_MODE) && defined (SUPPORT_MSG_CNT)
            tInterfaceParameters.usConfig |= (MSG_MODE_RX_CNT);
        #endif
        tInterfaceParameters.usConfig &= ~USE_XON_OFF;
        tInterfaceParameters.ucMessageTerminator = '\r';
    #endif
   
    //#undef SERIAL_SUPPORT_DMA
   
    #ifdef SERIAL_SUPPORT_DMA
        tInterfaceParameters.ucDMAConfig = UART_TX_DMA;                  // activate DMA on transmission
    #endif
    if ((SerialPortID = fnOpen( TYPE_TTY, FOR_I_O, &tInterfaceParameters )) != 0) { // open or change the channel with defined configurations (initially inactive)
   
   
        fnDriver( SerialPortID, ( TX_ON | RX_ON ), 0 );                  // enable rx and tx
       
        fnDriver( SerialPortID, (MODIFY_CONTROL | CONFIG_RTS_PIN), 0 );
        fnDriver( SerialPortID, (MODIFY_CONTROL | CLEAR_RTS), 0 );   
    }
   
}

void fnTimer_0(void);

static DMA_TIMER_SETUP  timer_setup_RTS_negate;

void fnTimer_0(void)
{
TOGGLE_APP_LED_THIRD();
fnDriver(SerialPortID, (MODIFY_CONTROL | CLEAR_RTS), 0);
}

extern void fnUARTFrameTermination(QUEUE_HANDLE Channel)
{
if (Channel == 2) {

timer_setup_RTS_negate.int_type = DMA_TIMER_INTERRUPT;                       
timer_setup_RTS_negate.channel = 1;
timer_setup_RTS_negate.int_priority = DMA_TIMER1_INTERRUPT_PRIORITY;
timer_setup_RTS_negate.int_handler = fnTimer_0;                // enter timer call-back
timer_setup_RTS_negate.mode = (DMA_TIMER_INTERNAL_CLOCK | DMA_TIMER_SINGLE_SHOT_INTERRUPT);
timer_setup_RTS_negate.count_delay = DMA_TIMER_US_DELAY(1,1, 620);

TOGGLE_APP_LED_SECOND();

fnConfigureInterrupt(&timer_setup_RTS_negate); // start delay to RTS negation
}
}

void PP_WriteComm(unsigned short int usSize, unsigned char *pucOut)
{
.
.

  TOGGLE_APP_LED_FIRST();
 
  fnDriver(SerialPortID, (MODIFY_CONTROL | SET_RTS), 0); // driver RTS ‘1’
 
  fnWrite(SerialPortID, pucOut, usSize);
 
.
.
.
}


void fnTaskPPReceive(TTASKTABLE *ptrTaskTable)
{
.
.
.
}

I tried a lot of different combinations, negated RTS, changed count_delay, (for SP485)connected only RTS to RE*, connected both RTS to RE* and CTS to DE, connected CTS to ground, connected RTS to RE* and DE, used
Code: [Select]
fnDriver( PortID, (MODIFY_INTERRUPT | ENABLE_CTS_CHANGE), 0 ); , and many different combinations with no luck.

What can I do now, or maybe Neil can share some thoughts/experience with us?

Best regards...

2
NXPTM M522XX, KINETIS and i.MX RT / Re: Porting Code to M5229
« on: September 28, 2009, 04:41:58 PM »
Mark,

I am trying to follow the http://www.utasker.com/docs/uTasker/uTaskerUART.PDF doc for RS485, but it does not match with V1.4 code, there is no TIMER_INTERRUPT_SETUP class defined, there is no definition for TIMER_INTERRUPT, TIMER_US_VALUE, TIMER_SINGLE_SHOT, it is not clear also if 52259 supports hardware controller RTS, and all the 485 support got mixed up with MODBUS support.

I am just trying to use a 485 device on UART2 on M52259DEMOKIT. I connected an SP485 to UART2; UTXD2/URXD2 to RO/DI, URTS2* to RE/DE...Tried the hardware support option first, but couldn't make it work, I turned to software support but its complicated...

Thanks in advance...

3
NXPTM M522XX, KINETIS and i.MX RT / Re: Porting Code to M5229
« on: September 26, 2009, 10:16:00 PM »
Hi,

You were right, CW was the problem. I was using 7.1.2, and I also upgraded the firmware on two of my M52259DEMO boards, so 7.1.1 couldn't connect them.

Now I am using 7.1.1 with a new (not upgraded) demo board. I can program and debug the board, but here is what I do: I first unplug and then plug USB BDM, then I hold down SW2 switch while I am programming flash (Erase/Blank Check, Program/Verify). Otherwise it always fail with different errors, unable to verify, timed out, unable to read, etc...

I also commented out the INIT_WATCHDOG_DISABLE and WATCHDOG_DISABLE macros and enabled these (they were commented out):

#define INIT_WATCHDOG_DISABLE()    (PNQPAR &= ~(ALT_2_FUNCTION_Q << BIT_1_Q_SHIFT)) // ensure IRQ1 is an input (SW2 on demo board)
#define WATCHDOG_DISABLE()         (!(PORTIN_SETNQ & PORT_NQ_BIT1))  // pull this input down to disable watchdog

With this two macros I can also debug the board, the other two didn't work.

So I have two new questions.

1.Can I use the UARTs for rs485 connections; on NE64, there were two ports and one was configured by a jumper and two pins for rs485 communications?

2.Can I downgrade the two boards so that I can reuse them?

Thanks in advance...


4
NXPTM M522XX, KINETIS and i.MX RT / Re: Porting Code to M5229
« on: September 22, 2009, 01:55:08 PM »
Hi mark,

I did that, I ran the demo web application,uploaded the files(ftp), and tested the application, everything works fine (of course after _usHeaderLengthAndFlags bug is resolved)...

I configured PORT_TC_BIT1 to toggle when application task is called since I cannot debug (CW cannot place breakpoints and gives error that I cannot place more even if I dont have one and other errors!)... And when I run the code, LED2 is toggled only once, LED1 (watchdog) is toggled 15 times, and then board resets...

My code just opens a TCP port for communication and uses serial port to communicate to an external device, but I disabled the serial port...

Thanks in advance...


5
NXPTM M522XX, KINETIS and i.MX RT / Porting Code to M5229
« on: September 22, 2009, 01:24:59 PM »
Hi,

I have a working uTasker project for NE64. I am trying to convert this to KIRIN3 with no luck. I am adding my custom code from NE64 project, and configuring TaskConfig.h of the uTaskerV1.4_M522XX project to enable these new tasks. But it does not work. I cannot debug it either, if I put a breakpoint on first line of my application task and try to step over(F10),it never steps over to the next line, it stays on that line...

Can anybody help?

Best regards...

6
FreescaleTM MC9S12NE64 / Re: Adapt9S12NE
« on: October 20, 2008, 09:32:31 AM »
Hi, mark

I have somehow made it work, I will post the start12.c when I simplify it...

Now I have another problem, rs485 port of this board runs if port E bit 5 and bit 6 is set 0&1...also this port echoes back the written characters, I was using a code like this before:

Code: [Select]
// Disable Receive Interrupt
    SCI1CR2_RIE = 0;
// Wait until transfer data register empty
        while(!SCI1SR1_TDRE);

// Put byte
        SCI1DRL = *pucOut;

// Wait for a small period of time
        for(i = 0; i < 10000; i++)
{
    if(SCI1SR1_RDRF)
            break;
}

// Echoed back
if(SCI1SR1_RDRF)
{
    // Read echoed character
    echoIn = SCI1DRL;

// If parity flag is set
if(SCI1SR1_PF)
{
    // Return parity error
    error = (ERR_PARITY);
break;
}
if(echoIn != (*pucOut))
{
    // If echoed character is not the same as we put in,return communication error
    error = (ERR_COMNUM);
break;
}
}
else // If it is not echoed back,there is an error
{
    error = (ERR_TIMEOUT);
break;
}

How can I do this using uTasker?

7
FreescaleTM MC9S12NE64 / Re: Adapt9S12NE
« on: October 16, 2008, 08:39:47 AM »
I have changed start12.c, (i created a new empty project and compared it with utasker), and I am now able to debug using codewarrior...

But it does not work still, no task is activated: "if (ptTaskTable->ucTaskState & (UTASKER_GO | UTASKER_ACTIVATE))" this always returns false...

Mark, can you please check this map file and tell me if anything is wrong?

Thanks in advance...

8
FreescaleTM MC9S12NE64 / Re: Adapt9S12NE
« on: October 14, 2008, 07:45:32 PM »
Also, how can I use uTasker with ICC, I dont have much experience with CW, no experience with IAR(just heard it), and GNU builds are not acceptable since they are too big...

9
FreescaleTM MC9S12NE64 / Re: Adapt9S12NE
« on: October 14, 2008, 07:42:01 PM »
Hi, Mark

I cant communicate from the network...

I couldn't debug it using CW, I have a microbdm12s but i couldnt make it work either...In fact, I have never been able to debug this board before, all I did was sending some characters through serial port and hundreds of fbulk-fload, but it was a custom code which have a giant main module, it is also based on uIP, but I am having some problems with it, so I thought I should use a stable IP stack...In short I cant say it crashes, and if it crashes, where...

I also had the auto-negotiation problem with my old program, so I already changed it. I didnt look much into uTasker code, I just changed ip settings,run the simulator(it runs perfect) and made a GNU build from Visual Studio 6,and loaded it...

I will look into the LED thing tomorrow...

All the people on this forum seem to use en eval board, so I asked if anybody had a similar experince with Adapt9s12NE...

I will ask for more help tomorrow when I go to work with details :D

Thanks in advance...

 

10
FreescaleTM MC9S12NE64 / Re: Adapt9S12NE
« on: October 14, 2008, 04:17:35 PM »
Second part of the attachment...

11
FreescaleTM MC9S12NE64 / Adapt9S12NE
« on: October 14, 2008, 04:16:46 PM »
Hi,

I only changed the ip/submask and compiled in GNU,IAR,CW,but none of them works on my Adapt9S12NE.
What can be the problem?

ps.I am adding the psa and s19...

12
µTasker general / Re: Evaluation License
« on: October 13, 2008, 03:08:47 PM »
Hi,

Sorry about this, we have a spam filter (esafe) which reports blocked content once a day by mail, and I never thought it would be blocked,I asked the network admin about the mail and there it was...

Thanks id advance...

13
µTasker general / Evaluation License
« on: October 13, 2008, 01:55:59 PM »
Hi,

how long does it take to get an evaluation license?

best regards...

Pages: [1]