Author Topic: Adapt9S12NE  (Read 10536 times)

Offline sefai

  • Newbie
  • *
  • Posts: 13
    • View Profile
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...

Offline sefai

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Adapt9S12NE
« Reply #1 on: October 14, 2008, 04:17:35 PM »
Second part of the attachment...

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3069
    • View Profile
    • uTasker
Re: Adapt9S12NE
« Reply #2 on: October 14, 2008, 05:32:51 PM »
Hi

When you say that the board doesn't work, do you mean that the code doesn't run (eg. it crashes) or can't you communicate from the network? You can verify that the code is running if you have a debugger by stopping and checking that the code is still executing correct code. Also an output will flash at 2.5Hz (you may not have the same output connected to an LED though on your board - check the demo tutorial for output port details).

The Ethernet part should be fully compatible on any HW.

If the board is running but you have no Ethernet connection it may be due to the auto-negotiation bug in the NE64 - see the following http://www.utasker.com/forum/index.php?topic=254.msg991#msg991 - the same is relevant for the NE64.

Regards

Mark

Offline sefai

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Adapt9S12NE
« Reply #3 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...

 

Offline sefai

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Adapt9S12NE
« Reply #4 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...

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3069
    • View Profile
    • uTasker
Re: Adapt9S12NE
« Reply #5 on: October 14, 2008, 09:46:00 PM »
Hi

Personally I don't have any experience with the board you are using nor with ICC.

You can also load some reference SW (pre-compiled) from here if you are not sure that the compile is correct.
http://www.utasker.com/software/software.html.

If your board contains the serial monitor (for loading and debugging via UART) you can also use the simple debug tool in \Tools\NE64
Check also that you have the latest service pack since I am not sure that the original GCC version relied on the serial monitor to configure the internal RAM (I didn't see any notes in the SP though, so this is was probably already solved in the V1.2 project).

Note that, unless there is some important reason why you need to use the NE64, it is recommended to move to the M5223X family. These are much easier to work with and much more powerful - the chips are in fact cheaper than the NE64 too! The M52233DEMO board costs $99 and includes debugger and professional 128k code limited compiler (this is enough for most real projects). The NE64 is not recommended for new projects and its support will generally not be further developed.

Regards

Mark





Offline sefai

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Adapt9S12NE
« Reply #6 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...

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3069
    • View Profile
    • uTasker
Re: Adapt9S12NE
« Reply #7 on: October 16, 2008, 10:32:35 AM »
Hi

I didn't notice anything in the map file which explains anything.

However you should find that fnTaskWatchdog() always runs immediately. This is because its state us set to UTASKER_GO.
Therefore you are either missing this occurrence or else the table content is not being initialised correctly. When the main scheduling loop operates you can expand the task entry structure to check that it is valid - it should correspond to the table ctTaskTable from TaskConfig.h.

After this the TICK interrupt is required for the system to operate. It may be that interrupts are not operating correctly so check that they have been unmasked when leaving the start up code.
In NE64.c the timer is initialised (fnStartTick()) and the interrupt is called RealTimeInterrupt()
This must be firing every approx. 50ms.

Regards

Mark

Offline sefai

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Adapt9S12NE
« Reply #8 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?
« Last Edit: October 20, 2008, 11:53:52 AM by mark »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3069
    • View Profile
    • uTasker
Re: Adapt9S12NE
« Reply #9 on: October 20, 2008, 12:13:49 PM »
Hi

As I understand it, you are receiving echos of the data send onto the RS485 bus.
You could possibly add your code to the transmission routine:
fnTxByte() in NE64.c

Alternatively you can send the data with disabled rx so that there are no echos (this will however not allow you to detect when the bus is open). You can use the TX_FREE interrupt event to signal when the tx buffer has emptied (tInterfaceParameters.ucFlowLowWater = temp_pars->temp_parameters.ucFlowLow; will need to be set to 0).
See the following for an introduction to using TX_FREE on the UARTs: http://www.utasker.com/forum/index.php?topic=330.0

The last method would be to not check each 'echoed' character in the transmission routine itself but rather in the application receive routine (this would probably be the most efficient solution since it doesn't involve any polling in the transmission routine). In the demo project application.c is being woken on each received character - it reads the input queue and could also check that the received data stream is equal to the transmitted data stream.

Regards

Mark


Offline thamanjd

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Adapt9S12NE
« Reply #10 on: October 21, 2008, 06:26:51 AM »

If it comes to it, you can disable uTaskers serial functions and uTaskers serial interrupts and use your own interrupts, functions and serial setup routines. I did this for some code that was ported over from an hc08 series project.


JD