Author Topic: Simple new project for a newbie??  (Read 9743 times)

Offline StanTheMan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Simple new project for a newbie??
« on: January 03, 2008, 07:00:09 PM »
Ok, I'll admit I am real new to this but would like some help in starting a new project. The demo project is great but I am kind of getting lost in the code examples. Is there anyone whom has a simple example of say using the UART and TCP/IP? What are the bare minimum files I need to do a project? Once I understand the simple things I can move on to the more complex designs.

I am working with the MCF52235EVB trying to learn how I can apply this to the real world.

Thanks much,
Stan
;D

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Simple new project for a newbie??
« Reply #1 on: January 04, 2008, 10:49:24 PM »
Hi Stan

The demo project is has a bit of everything in it. It tries to provide a simple project but at the same time quite a complete set of tools - this is of course not a simple balancing act!

If you go into the configuration file config.h you can turn off almost everything and then just activate the things that you need for your particular tests. For example if you deactivate the Ethernet interface (comment out #define ETH_INTERFACE) it will remove the interface and all TCP/IP parts, leaving not much more than a blinking LED and serial interface, if desired. (Individual protocols and features can usually be controlled in a similar way - eg. activate the Ethernet but deactivate TCP and UDP to leave just ICMP and ARP for a ping test...)

However there is not a great deal of sense in doing this unles you want to strip the code size to the smallest possible for some reason. The reason is that the project uses the uTasker OS which effectively means that all modules are running as tasks and so can be considered in isolation to each other (modular). The file application.c does still define a details about which of the services are actually started and this file can be manipulated for more control for your own tests.

I would also use the search function in the forum since most of the individual topics are handled in some detail with general code examples.
Examples are:
TCP: http://www.utasker.com/forum/index.php?topic=25.0
UART http://www.utasker.com/forum/index.php?topic=54.0

If you concentrate on the particaular code parts of interest, you should be able to focus on the parts which are relevant for yourself without getting lost in the rest.

Good luck

Regards

Mark


Offline StanTheMan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Simple new project for a newbie??
« Reply #2 on: January 07, 2008, 10:44:30 PM »
Where does the menu that is supposed to get output when you hit the enter key on the serial Terminal get defined? I do not see this happening when I hit the enter key. All I do see is the echo back of the characters I have typed.
Ultimately I would like to create a function that queries a device on the serial port and retrieves a response from that device that would get displayed on a web page. Also would like to be able to send from the web page to the SCI device too.

Thanks much,

Stan

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Simple new project for a newbie??
« Reply #3 on: January 07, 2008, 11:37:05 PM »
Hi Stan

When a character is received at the UART input, the task in application.c is woken. It reads the input and the echo takes place in fnEchoInput();

If (usData_state == ES_NO_CONNECTION) is true (that is as long as there is no Telnet connection active) the function fnCommandInput() is called. This is in debug.c.

This routine collects the input until '\r' is detected. (carriage return).

Depending on your terminal emulator, and its setting, it may be that hitting return is sending a line feed and not a character return (possibly plus line feed). The code ignores line feeds. I use TeraTerm - this is freeware and recommended as good and reliable general purpose terminal emulator (with Telnet capability too - it tends to work better than Hyperterminal which has a nasty bug in some of its file transfer modes... ) TeraTerm is available at http://www.mjbc.ch/software/freeware/teratermpro.zip.

Regards

Mark