Simple Universal Protocol Project
20111225 PDF Print E-mail
Written by Administrator   
Sunday, 25 December 2011 16:35

Simple Universal Protocol is a project that tries to create an instrument that will help you connect MCU with the PC by USART.

This release contain NET Framework DLL that can be included to your embedded application.

Now, it's more easy, to use a protocol for embedded applications with minimal code writing.

You need about 10-15 strings of your code to start your project. Also it have sample of connecting ATMEGA8 with PC by USART. All sources included. Now, it's easy to migrate from one application to other without source changing.

Documents: ENG.pdf; RUS.pdf

 

DLL extension.

Version differs from previous releases.

In previous versions, Simple Universal Protocol was presented as embedded class that was not a convenient solution.

Now, all encapsulated in the component “uComp.dll”.

This makes it more easy, to use a protocol for embedded applications with minimal code writing.

Details in the archive.

 

At left panel you can see sample video, were it used for ADC reading(sine generator enabled) and PWM duty cycle writing(by TrackBar) at ATMEGA8 crystal.

 

If you see it, you will be pleasantly surprised that all source code on C# that controls this process is:

 

namespace Mega8Example

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void Form1_Load(object sender, EventArgs e)

{

uComp1.STACK.Create(8);

}

private void button1_Click(object sender, EventArgs e)

{

if (uComp1.isConnected == false) {

uComp1.PortName = comboBox1.Text;

uComp1.BaudRate = 9600;

uComp1.Connect();

timer1.Enabled = true;

}

}

private void timer1_Tick(object sender, EventArgs e)

{

if (uComp1.AllOperationsComplete == true)

{

label1.Text = uComp1.STACK.BLOCKS.Storage[0].UINT32.ToString();

uComp1.STACK.BLOCKS.Storage[0].NeedToRead = true;

}

}

private void trackBar1_ValueChanged(object sender, EventArgs e)

{

uComp1.STACK.BLOCKS.Storage[1].UBYTE0 = (byte)trackBar1.Value;

}

private void OFFLINE_Click(object sender, EventArgs e)

{

uComp1.Disconnect();

}

private void uComp1_OnConnectionWrongChecksumFound(object sender, EventArgs e)

{

MessageBox.Show("Wrong Checksum found");

}

private void uComp1_OnConnectTry(object sender, uComp.uComp.COMConnectEventArgs e)

{

MessageBox.Show(e.ConnectionStatusLocal.ToString());

}

private void uComp1_OnDeviceRetryQuery(object sender, EventArgs e)

{

MessageBox.Show("Retry");

}

 

Tags: Connect MCU with PC ; Connect MCU with PC RS232, Connect MCU and PC USART(UART).

Connect PIC PC. Connect ATMEGA PC

 


 

Last Updated ( Sunday, 25 December 2011 22:33 )
 
ABOUT PROJECT(OLD) PDF Print E-mail
Written by Administrator   
Tuesday, 26 July 2011 22:13

 

RELEASED

You can download sources.

License: GPL


Simple Universal Protocol(Next SUP)

This is an attempt to create tool that can help you connect MCU with PC by UART.

PC level(IO class) written on C#. Hardware level written with MCC18 for PIC18F2520

If you will deal with source code, it’s not difficult to migrate on your MCU, change name of blocks, use this class or

rewrite it for own need.

History.

Sometime we need to read and write some data from MCU. It can be sensor information, calibration variables and

etc. Sometimes we need to read or write one variable, sometimes there are a lot of variables. I have seen some

ready protocols. I dislike them for redundancy, large execution time (for 8 bit MCUs), high data memory use.

Often, we needn’t network of MCUs and PC.

These sources were useful for me to solve problem of reading sensors from control system

and adjust work parameters in real time.

 

 

 

Data Model

 

 

Figure 1. Data Model

 

Data memory consists of 32 blocks, each has 32bit capacity. PC is a master device.

Any write operation to block at PC program will automatically synchronize changed PC block with MCU block.

For example. If you will write in your own source code next:

 

IO.STACK.B1.UINT32=0xAABBCCDD;

It will change IOGlobalVars.BlockNotSynchronized[number of block] to true

When MCU accept new data, IOGlobalVars.BlockNotSynchronized[number of block] will be false.

Data will be automaticacly transfer to MCU. You work with blocks at PC as with memory mirror of MCU.

If you want to receive data from MCU, you will write code IOGlobalVars.ReadBlock(BlockNum);

It will change IOGlobalVars.BlockNotSynchronized[LastQueryBlock] to true

When data receive complete IOGlobalVars.BlockNotSynchronized[LastQueryBlock] will be false.

 

 

 

Last Updated ( Sunday, 25 December 2011 16:39 )
 
joomla templateinternet security reviews
Agriculture template by kaspersky review