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 ... 27 28 [29] 30
421
µ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

422
µ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

423
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

424
NXPTM M522XX, KINETIS and i.MX RT / Uart Question
« on: September 07, 2007, 08:46:49 PM »
Hi,
  When any of the 3 uarts are setup (in 52235) to be used for DMA or interupt driven. I would like to check to make sure any previous data within buffer has been fully sent before sending next one, how do I do this?  This will prevent me of having a large buffer, preventing overflow.

Regards
Neil

425
Hi Mark,
  Its a  pitty that the 52235 doesnt have an on board USB, as I will have to communicate with some USB devices. I have a few samples of a
'USB Peripheral/Host Controller with SPI Interface' device from maxim.  http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3639

I am designing a prototype board, and inserting this onto the spi bus. I will only be using it to connect to devices and communicating. I am new to USB, so will have a learning curve first to tackle :'(

Neil

426
µTasker general / Serial Port
« on: August 02, 2007, 03:56:39 PM »
Hi,
  I have a serial port configured as UART_TX_DMA for sending.  How do I know when all the data is sent? Just so the applicaiton can send another block known that the previous wont be overwritten before being sent.

Regards
Neil

427
NXPTM M522XX, KINETIS and i.MX RT / sprintf(..)
« on: July 31, 2007, 02:53:39 PM »
Hi,
  I have included stdio.h within application.c so I can use sprintf(..), but the compiler complains regarding 'typedef unsigned int size_t;' which is in the types.h file of utasker. Any point me to the way around this?

Thanks
Neil
 

428
Hi,
   Has anyone used USB to UART chip?  There are various chips out there that does it, but I am not sure how good they are. Any feedback would be excellent,as we hope to include USB later this year.

Here is a link to one on the farnell web page. Its the development board, but they also do the chips. I havent looked yet too much into this, so cant really give an opinion yet.

http://uk.farnell.com/jsp/Semiconductors/Development+Tools+&+Programming/displayProduct.jsp?sku=1146036&_requestid=294758

Neil

429
µTasker general / Re: Boot Loader
« on: July 26, 2007, 12:59:28 PM »
Hi Mark,
  When a firmware updated is needed, my own code has to save the new firmware (will be either from ethernet, or GPRS (serial)) onto external memory (this is the way we want to go), and do we simply reset the processor, then the bootloader will come into play?

How does the bootloader know where the file is? We will have 2 external eeproms, one for firmware, and one for our own data. As we will be using the 1MB (actually a bit larger), we would like to use the rest of the chip for our own data, would this be a problem?

We save data on the flash every minute, and because  there is a maximum writes per page we have to be carefull of not using same pages too often (as the page gets cleared when data is sent to our server), so we never reset the save pointer, always increase , then loop to start again. Do you do the same?

Is there anyway we can use data card, that holds 16MB etc too?

You mention that you do not use the 52235 own spi chip select, but an IO, but you use the SPI interface (and not IO lines for communication)?

Regards
Neil

430
µTasker general / Re: Using TCP in the uTasker project
« on: July 25, 2007, 02:28:37 PM »
Hi Mark,
  Nice article above.

Regarding 'TCP_EVENT_REGENERATE'. You mention that the previous message must be resent. Is there a chance that there can be an endless event, where the call back keeps getting 'TCP_EVENT_REGENERATE' everytime the message is resent (for some weird reason)? If so I assume that its best to retry 'x' amount of times before closing the connection?

I have written a lot in sockets on Windows applications, and never had to worry about the lo-level 'ACKs' etc as these are all hidden. So please excuse my basic  questions  :)

I understand that if I simply receive a 'TCP_EVENT_REGENERATE', I do a resend. And if I get a 'APP_SENT_DATA', the data was transmitted/received okay.
I thought the only messages I would really have to manage are 'TCP_EVENT_REGENERATE' , 'APP_SENT_DATA', 'TCP_EVENT_CONNECTED'. But after I resend if a  'TCP_EVENT_REGENERATE'  is returned, I will get a ''TCP_EVENT_ACK' instead of a  'APP_SENT_DATA' . Is this correct?

But if the data cannot be resent, if I receive a  'TCP_EVENT_REGENERATE', I simply wait for a ''TCP_EVENT_ACK' before doing anything else with the socket (apart from closing it)?

Is that the basics, or am I missing something else  ???
Thanks
Neil
 


431
µTasker general / Re: Using TCP in the uTasker project
« on: July 23, 2007, 04:08:16 PM »
Hi mark,
  Regarding the previous problem of not being able to connect.

With the problem above, not connecting, I was trying it on the sumilator. I now copied the code into the 52233 flash. And it worked fine, without modifying any code.

Within the call back routine above 'static int fnTestListener(USOCKET Socket, unsigned char ucEvent, unsigned char *ucIp_Data, unsigned short usPortLen)' is 'ucIp_Data' a pointer to the data read in, and 'usPortLen', The number of characters?

Regards
Neil

432
µTasker general / Re: Using TCP in the uTasker project
« on: July 23, 2007, 03:06:16 PM »
Hi Mark,
  Thanks for the reply.
It worked fine as you mentioned, I just never realised that the header had to be included, just thought need to provide a buffer,but worked fine.

It strange, as I tried it , and all worked fine, I then closed my server and simulator. Then re-ran them the same way. The simulator tried to connect, but a connections didnt make a connection. Ive tried it several times, but no luck. Ive managed 2 connections from about 10 attempts. If I run my windows client application we use, we can do the exactly the same thing I am trying with the simulator, and everytime it connects tot he server.

Regards
Neil

433
µTasker general / Re: Using TCP in the uTasker project
« on: July 22, 2007, 01:08:13 PM »
Hi mark,
  After succesfully connecting to my server application (Windows based), I thought I would send some data. I want to send the following block of data, which my server application understands as a command:

After a connection is made, within the call back function I insert the code to send to my server, as follows:

unsigned char Buff[10];
//call back function
static int fnTestSocket(USOCKET Socket, unsigned char ucEvent, unsigned char *ucIp_Data, unsigned short usPortLen)
{
   TCP_MESSAGE test_message;

    switch (ucEvent)
   {
         case TCP_EVENT_CONNECTED:
                Buff[0]=0;
                Buff[1]=5;
                Buff[2]=233;
                 Buff[3]=5;
                Buff[4]=32;
                          if (fnSendTCP(Socket, &Buff[0], 5, TCP_FLAG_PUSH) > 0)
                   return APP_SENT_DATA;
                         break;

                    ....
             }


The above gets sent, but when I debug my server application, the above values are not received, there are 5 characters sent, but not the above.

Can you point me to where I am going wrong?

Regards
Neil

434
µTasker general / Re: Boot Loader
« on: July 21, 2007, 09:17:49 PM »
Hi Mark,
  Mid august will be fine for me, as I can design the board around this.

  The device has 4096 pages with 264bytes/page, giving it a total of 1081344 bytes. I think the layout is the same as the smaller part, but with more pages (not sure though). Heres a link to the datasheet: http://www.atmel.com/dyn/resources/prod_documents/doc2225.pdf

At present I simply save data results from page 100 to 4095, below 100 for applicaiton setup. I have a 264 bytes buffer in my processor, and fill this up. When time to save, I simply save the whole page, which is a lot quicker than saving byte per byte. Its a bit more tricker when the data overlaps the page boundry. This is where I then load the next page, and patch in the rest of the data to save. I have a structure which deals with the position with the memory. As you can see, its nothing fancy, but this way I can save a lot of data there, with ease. My application only saves data, and not seperate files, so no need for FAT tables etc.

Neil

435
µTasker general / Re: Boot Loader
« on: July 21, 2007, 07:22:08 PM »
Hi mark,
  excellent, at present I am using the atmel part 45DB081D (1MB) which is an excellent part. I havent designed the board yet, waiting till I fully test utasker (which so far is excellent). But if the bootloader will soon be available for this part then that would be great. Do you recon this feature will be available soon?

My application will be using the  45DB081D (as well as another one for bootloader ;) ) , can I use the file system on this one too? If I also have 2 , I assume it will be a matter of selecting which qspi chip select to use on which device, as there are 4 available?

If I use the 45DB081D for bootloader too (its cheap, and as I have many of these, dont want to purchase smaller versions), I assume that I can use the free space for other things too, like program setup etc?

Thanks again
Neil

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