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

Pages: 1 [2]
16
µTasker general / Re: Simulator for serial port data
« on: September 10, 2009, 03:27:20 AM »
Fixed the exception.
I had to change #define NUMBER_SERIAL to  (4) from 3.
The USB--> serial converter  creates COM3 as the virtual COM port in my
64 bit vista system.
Hence I had to define  #define SERIAL_PORT_3        3  .
I have verified that the virtual COM port is functional, using moni.
Running the simulation with the GPS sentences coming in on the COM port:
while ((length = fnMsgs(SerialPortID)) != 0)
SerialPortID= 19
length=52428-----> and the buffer contains garbage.
Any ideas why the characters are not making into the buffer?

Thanks!!

17
µTasker general / exception when simulating
« on: September 10, 2009, 01:42:19 AM »
#include "config.h"
#define OWN_TASK                 TASK_MY_FIRST_TASK
//Prototypes
void setUart(unsigned char mode);
// Global variables
static QUEUE_HANDLE SerialPortID;      // quehandler for serialport 3


extern void fnMyFirstTask(TTASKTABLE *ptrTaskTable)
{
   QUEUE_TRANSFER length;
    unsigned char ucInputBuffer[100];
  static int iState = 0;
  static unsigned char ucCounter = 0;
  static const char LCDdsp[] = " From Lav's task";      // display message from present cursor position
  if (iState== 0)
   {   
      setUart(FOR_READ ); //Rx only
      iState = 1;
        }
while ((length = fnMsgs(SerialPortID)) != 0) {    // get number of waiting bytes
        if (length > sizeof(ucInputBuffer)) {     // ensure buffer can’t be overrun
            length = sizeof(ucInputBuffer);
        }
        fnRead(SerialPortID, ucInputBuffer, length);     // read to a local buffer
    }
  //  fnDebugMsg("Hello, World! Test number ");
   /* fnDebugDec(ucCounter++, sizeof(ucCounter));
    fnDebugMsg("\r\n");*/
   TOGGLE_LAV_OUT() ;
   fnDoLCD_com_text(E_LCD_TEXT, (unsigned char *)LCDdsp, (sizeof(LCDdsp) - 1));
   //uTaskerStateChange(OWN_TASK, UTASKER_GO);                // switch to polling mode of operation
}

void setUart(unsigned char mode)
{
   TTYTABLE tInterfaceParameters;       //table for passing information to driver
   
   tInterfaceParameters.Channel = SERIAL_PORT_3;  // serial 0, 1, 2, 3, 4, etc.
    tInterfaceParameters.ucSpeed =  SERIAL_BAUD_4800; // baud rate
     tInterfaceParameters.Rx_tx_sizes.RxQueueSize = RX_BUFFER_SIZE;       // input buffer size
   tInterfaceParameters.Rx_tx_sizes.TxQueueSize = TX_BUFFER_SIZE;      // outpu buffer size
      tInterfaceParameters.Task_to_wake = TASK_MY_FIRST_TASK;
   tInterfaceParameters.Config = (CHAR_8 | NO_PARITY | ONE_STOP | NO_HANDSHAKE | CHAR_MODE );               
   
   if ( (SerialPortID = fnOpen(TYPE_TTY, mode, &tInterfaceParameters)) != 0 )  // open or change the channel with defined configurations (initially inactive)
      fnDriver( SerialPortID, (RX_ON | TX_ON), 0 );        // enable RX & TX
   
}


I get this error;
Unhandled exception at 0x0046339f in uTaskerV1-4.exe: 0xC0000005: Access violation writing location 0x0000004b.
Will appreciate any help. thanx.

18
µTasker general / Simulator for serial port data
« on: September 09, 2009, 06:08:42 PM »
Hello,
This is what I am planning to do:
1) interface a Garmin GPS unit to my workstation serial port using a usb-serial converter.
2) I would like to use interrupts on the serial port, and it should interrupt on the line ending. The ISR will send a message to the GPS task to start processing.
3)  GPS task to process ( parse)  the GPS sentence.
4) Send LAT, LON and Speed over ground to LCD task.
I know how to go about steps 1, 3 and 4.
Is step 2 possible using  the simulator? At present I do not have any target hardware.

Thanks!!
Lav

19
µTasker general / inter task communication
« on: September 09, 2009, 01:33:40 AM »
Hello Mark, I was playing with the inter task communication using queues.

This is what I am doing:

fnDoLCD_com_text(E_LCD_TEXT, (unsigned char *)LCDdsp, (sizeof(LCDdsp) - 1));

The code above is executed in my task(source task). I am using the character LCD. I have disabled fnDoLCD every where else in the code to ensure that there is only one task writing to the LCD.(using the task queue).

The string is correctly displayed on the LCD in the simulator.
Question: How does the LCD task get the string from "MY TASK"?
I am confused because:
switch ( ucInputMessage[ MSG_SOURCE_TASK ] )  in the LCD task:
MSG_SOURCE_TASK= "L" meaning LCD task.
I checked the above using a breakpoint.
But the code below that:
case TASK_APPLICATION: is looking for "a"
meaning application task.
Thanks in advance.

20
µTasker general / Scheduling algorithm used in utasker
« on: September 08, 2009, 01:59:23 AM »
Hello, What is the scheduling algorithm used in utasker?
Thanks !!

21
Hello Mark, just started playing with the uTasker, using the simulator. It is awesome.
I was successfully able to create a new task as per your instructions.
Able to to see the "hello world" on a telnet connection using PuTTY.
Next, I disabled the GLCD, and enabled the character LCD.
The telnet now outputs the "hello world" and LCD = 0xFF.
The display on the simulator is OK.

Question: Where is the LCD =0XFF coming from?

the code snippet:

#include "config.h"
extern void fnMyFirstTask(TTASKTABLE *ptrTaskTable)
{
  static unsigned char ucCounter = 0;

    fnDebugMsg("Hello, World! Test number ");
    fnDebugDec(ucCounter++, sizeof(ucCounter));
    fnDebugMsg("\r\n");
    TOGGLE_LAV_OUT() ;  // toggles portB  bit 22
}

Pages: 1 [2]