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 - neil

Pages: 1 ... 26 27 [28] 29 30
406
µTasker general / Re: about the udp use!
« on: April 03, 2008, 12:44:51 PM »
Hi Mark,
  I have an application where I will be communicating with 1 piece of hardware using UDP( It is local to the board, about 3 feet away). My application will not be a server but a client. I understand that a UDP cannot make a connection, but their documentation regarding the UDP does mention a connection first. I looked into my trusty book 'Network programming for microsoft windows', and it does mention a connection (even though it does nothing) , here is the details from the book:

'Another method of receiving and sending data on a connectionless socket is to establish a connection. This might seem strange, but its not quite what it sounds like. Once the socket is created, you can call connect. No actual connection is made, however. The socket address passed into a connect function is associated with the socket so recv can be used  instead of recvfrom because the datas origin is known. The capability to connect a datagram socket is handy if you intend to communicate with only one endpoint at a time.'

My application will only be communicating (well with one socket, might have a tcp socket on another connection to my application on a windows machine)with one endpoint. Is this the way to go for my UDP socket?

Thanks
Neil

407
µTasker general / Re: about the udp use!
« on: March 14, 2008, 12:38:40 PM »
Hi,
  I am new to UDP, and have always used TCP. I understand (well, think), that UDP is connectionless, but that is as far as it goes.
The application I need is not being a server, but connecting to a server device. I simply want to connect to a server, send/receve data and close (well, dont know if there is a close command in UDP).

Thanks
Neil

408
µTasker general / UDP help
« on: March 14, 2008, 07:36:17 AM »
Hi,
   I have been using TCP/IP communication for a while, and now have a project using UDP which I havent had much experience with . Can anyone share some light on this for me?
 I think the topic http://www.utasker.com/forum/index.php?topic=25.0 on TCP is excellent, and wonder if there is something similar with UDP?

Thanks
Neil

409
µTasker general / using the DHCP
« on: February 19, 2008, 07:37:31 PM »
Hi,
  Is there any examples on how to use the DHCP to recieve its own ip address?
We are planning to use many in a  network, and dont want to have to set each one up.
Thanks
Neil

410
µTasker general / Connecting with a name rather than the IP address.
« on: February 19, 2008, 07:35:49 PM »
Hi,
  We wish to connect to a server application using the 'name' rather than its ip address as the destination is using a dynamic ip address.
  We are using TCP sockets.
Thanks
Neil

411
NXPTM M522XX, KINETIS and i.MX RT / Re: SD-CARD
« on: November 21, 2007, 03:12:59 PM »
Hi Fabio,
  Thanks very much for the links.

Neil

412
NXPTM M522XX, KINETIS and i.MX RT / Re: SD-CARD
« on: November 18, 2007, 02:35:49 PM »
HI,
  I am interested in having a look at an SD card, and cant find anything that describes the layout and programming of one. Can anyone point me to a site with thisinfo?

Regards
Neil

413
NXPTM M522XX, KINETIS and i.MX RT / Serial port with CTS & RTS
« on: October 29, 2007, 12:36:38 PM »
Hi,
  I am using a serial port with handshaking  lines CTS & RTS. If a send from the application is made to the port, and the device is not ready, indicated from CTS . How does utasker handle this?

Regards
Neil

414
µTasker general / Multiple Mono Timers
« on: October 21, 2007, 11:18:28 AM »
Hi Mark,
  Is it okay to have multiple MonoTimers at the same time? Is so, what is the maximum number?

I have the following 2 second timer in one task.
uTaskerMonoTimer( OWN_TASK, (DELAY_LIMIT)(2*SEC), E_TIMER_TIMEOUT );// start monitor timer

I would like to add another one to another task,so both will be operating at the same time,as follows:
uTaskerMonoTimer( COMMS_TASK, (DELAY_LIMIT)(60*SEC), E_TIMER_TIMEOUT );// start monitor timer

so during the 1 minute timer, the 2 second one may be executed at the same time on another task.

Regards
Neil

415
µTasker general / Re: Starting/stoping/continuing task...
« on: September 15, 2007, 08:29:53 PM »
Hi Mark,
  Your example below has the following:

while (fnRead( SerialPortID, &ucSerialInput[iSerialRxLenth++], 1) != 0) {
...
...
            }
   
You mention that the event gets woken up by timer, or interupt event. Would the task get woken up by a serial character coming in?

Neil

416
µTasker general / Re: Starting/stoping/continuing task...
« on: September 09, 2007, 10:38:06 PM »
Mark,
 
To schedule the task ONCE immediately, define the task like:
  { "My Task", fnMyTask, SMALL_QUEUE, (DELAY_LIMIT)(NO_DELAY_RESERVE_MONO), 0, UTASKER_ACTIVATE},

To schedule the task ONCE after an initial delay, like:
  { "My Task", fnMyTask, SMALL_QUEUE, (DELAY_LIMIT)(0.25 * SEC), 0, UTASKER_STOP},

UTASKER_ACTIVATE causes the task to be scheduled once and then automatically set back to the UTASKER_STOP state.

I see no advantage of ever using the UTASKER_GO state for your work because it will cause the task to be scheduled continuously, polling the queues (where events generally arrive) during that state. By letting the task be scheduled purely on events which are of interest to it it will only be run when it has something to actually do.

If the initialisation part is done globally, as the serial is also used elsewhere, I would therefore do the initialisation at another part. In this case I would do :
{ "My Task", fnMyTask, SMALL_QUEUE, (DELAY_LIMIT)(NO_DELAY_RESERVE_MONO), 0, UTASKER_STOP},


And the call fnInterruptMessage(MY_TASK, E_START_SEQUENCE); would wake it up and place it is UTASKER_GO, as the task has to be processed 20 times, this correct?

After the 20th time wouldnt I put the task back into UTASKER_STOP?

Neil


417
µTasker general / Re: Starting/stoping/continuing task...
« on: September 09, 2007, 08:20:42 PM »
Hi Mark,
  Thanks for the suggestion to my routine. Im really still getting used of doing things with tasks.. So please excuse my silly questions..

In your piece of code I understand the TIMER_EVENT which comes from the  uTaskerMonoTimer( OWN_TASK, (DELAY_LIMIT)(2*SEC), E_TIMER_TIMEOUT ); The INTERRUPT_EVENT is an interupt event, and the message E_START_SEQUENCE was passed to the task, but how do I pass the E_START_SEQUENCE message to the task ( I understand I can pass it from an IRQ for example, but what command to use)?

What is the fnMsgs(IICPortID)?

You mention it starts immediately once, then on Events only. I assume that this task is set to UTASKER_GO in the TaskTable, and is always getting called? So the message queue is checked to see if there are any messages, if not that task exits , else it deals with the messages . Then next time task is ran, same happens. Is this correct ?  I want to make sure I understand it okay...  :)

As this task is only started , say every 10 minutes, is it feesable to have the task in stop mode, and when the 10 minutes is up, set the task to UTASKER_GO, and within the task set it back to stop after the 20 samples have been carried out? The task still works the same but is only running when its time to sample.

Thanks
Neil



418
µTasker general / Re: Starting/stoping/continuing task...
« on: September 09, 2007, 07:37:44 AM »
Hi mark,
  Thanks for the reply.
 
  The reason I need this , every 10 mins, I have to take 20 serial readings from an instrument through the uart. I have an interupt from a rtc (DS1337) every second , and when reaches 10 minutes the task is woken up from the IRQ (I am not using the internal RTC, for other reasons). When woken, the task will take one sample, then the next time the task is processed, it will take the next reading, and so on. When all 20 has been read, the task itself will be placed back into stop mode.

In your example :
void fnMyTask(TTASKTABLE *ptrTaskTable)
{
  ....
   if (iRunTimes == RUN_TIMES) {                        // first time woken after sleeping
        uTaskerStateChange(OWN_TASK, UTASKER_GO);  // switch to polling mode
    }
 ...
}

If the task is in stop mode, how can it waken itself up? I will plan to use the uTaskerStateChange(OWN_TASK, UTASKER_GO)  within the IRQ interupt from the RTC.  What is the difference between polling, and running? I thought the UTASKER_GO puts it into run mode?

Is it possible to Halt the thread, and another thread can restart it from the place halted? If so how is this done?

Neil

419
µTasker general / Starting/stoping/continuing task...
« on: September 08, 2007, 01:29:44 PM »
Hi mark,
  I have a task that will initially be in stop mode, and will be woken up in a certain condition. And when woken , it will have to have a limit number of times ran (like having a for/next loop of say 20), and say the 20th time ran it will have to be stopped. Is it possible to stop a running task from when in that task (if so how is this done)?

Also..
 Within the task (actually same task)is it possible to halt the task , and in another task wake it up to continue again, as an example (including above scenario) of what I wish, if possible:

  when a certain condition appears, start task...

Task routine (not a for/next loop inside task but uses a global counter for each time task ran):
1.  send data out on serial port..
2.  Halt task here, allowing other tasks to run..
3.  woken  up here by interupt (serial or timer)... (see below)
4.  has task ran 20 times
5.  If yes, then stop task...
6.  task routine finished.

Serial routine..
After serial sent , No 1 above, the serial routine will receive data, and restart the task, No3 above..

Second Timer interupt...
if serial not received data (above) in 'x' amount of seconds, the timeout flag set, and above task is started No 3..

Is the above possible? If so how is it done? Not the serial and timer interupts I can handle that no problem, its just the halt/continue/stop a task is the problem..

Regards
Neil

420
NXPTM M522XX, KINETIS and i.MX RT / Interupts
« on: September 08, 2007, 12:39:28 PM »
Hi,
  The project I am working on uses various interupts, and would like to know how they work with the utasker. Below is a list of ones I am using (at moment), and as not yet tested the II2, and SPI.

1. The serial ports:
I am using the 52235, and will be using all 3 serial ports in interupt modes (as explained in previous post on Uart). I assume that the data will be sent when the tx register is empty, and when data is in the rx register the serial interupt will place the character in the RX buffer (size declared when setting up port)?  So if the processor is half way through a task, data is either sent/received (we wont lose any characters, unless of course there is a buffer overflow)?

2. IRQ1-15 interupts , edge detect.
How do these work? Is the function that is used in the setup automatically get  called by the isr?

3. II2 and SPI.
I still have to try these in utasker, does this work on interupts, or as transfer is fast, the task waits till data is received before moving to next application command.

4.Ethernet..
I will be using tcp/ip with simple connect and send. How does this work? Similar to the serial as described above?

Thanks
Neil

Pages: 1 ... 26 27 [28] 29 30