485demo
所属分类:串口编程
开发工具:Visual Basic
文件大小:3365KB
下载次数:49
上传日期:2009-07-27 23:46:07
上 传 者:
iamuniverse
说明: 通信协议解析。485总线设备。收发都可以。但需要下位机。看看大家会有帮助
(Analysis of communication protocols. 485 bus equipment. Can send and receive. But the next bit plane. Be helpful to see)
文件列表:
调试软件源代码\Form1.frm (32608, 2009-06-02)
调试软件源代码\Form1.log (1177, 2009-07-16)
调试软件源代码\K.CTL (4832, 2005-01-17)
调试软件源代码\MSCOMM.OBJ (48204, 2003-03-24)
调试软件源代码\MSCOMM.SBR (0, 2004-11-02)
调试软件源代码\MSSCCPRJ.SCC (190, 2004-11-08)
调试软件源代码\MyButton.obj (36098, 2003-03-24)
调试软件源代码\MyButton.sbr (0, 2004-11-02)
调试软件源代码\MyEdit.obj (11222, 2003-03-25)
调试软件源代码\MyEdit.sbr (0, 2004-11-02)
调试软件源代码\MyStatic.obj (10671, 2003-03-22)
调试软件源代码\MYSYS.SAV (2, 2000-01-01)
调试软件源代码\StdAfx.obj (105798, 2003-03-24)
调试软件源代码\StdAfx.sbr (1361638, 2004-11-02)
调试软件源代码\Tedit.obj (10467, 2003-03-25)
调试软件源代码\Tedit.sbr (0, 2004-11-02)
调试软件源代码\VC60.IDB (254976, 2004-03-15)
调试软件源代码\VC60.PDB (413696, 2004-03-15)
调试软件源代码\包\setup.exe (139776, 2001-01-16)
调试软件源代码\包\SETUP.LST (3779, 2009-07-27)
调试软件源代码\包\Support\ASYCFILT.DLL (147728, 1999-03-08)
调试软件源代码\包\Support\COMCAT.DLL (22288, 1998-05-31)
调试软件源代码\包\Support\MSCOMCHS.DLL (12800, 1998-07-07)
调试软件源代码\包\Support\MSCOMM32.OCX (103744, 1998-06-24)
调试软件源代码\包\Support\msvbvm60.dll (1386496, 2004-02-23)
调试软件源代码\包\Support\OLEAUT32.DLL (598288, 2000-04-12)
调试软件源代码\包\Support\OLEPRO32.DLL (164112, 1999-03-08)
调试软件源代码\包\Support\SETUP.EXE (139776, 2001-01-16)
调试软件源代码\包\Support\Setup.Lst (3779, 2009-07-27)
调试软件源代码\包\Support\SETUP1.EXE (249856, 2001-01-16)
调试软件源代码\包\Support\ST6UNST.EXE (73216, 2001-01-16)
调试软件源代码\包\Support\STDOLE2.TLB (17920, 1999-06-03)
调试软件源代码\包\Support\VB6CHS.DLL (102160, 2000-10-02)
调试软件源代码\包\Support\VB6STKIT.DLL (101888, 2001-01-16)
调试软件源代码\包\Support\发油调试.BAT (182, 2009-07-27)
调试软件源代码\包\Support\发油调试.exe (81920, 2009-07-27)
调试软件源代码\包\Support\工程1.DDF (527, 2009-07-27)
调试软件源代码\包\发油调试.CAB (1420738, 2009-07-27)
调试软件源代码\发油调试.exe (81920, 2009-07-27)
... ...
Test and example program #1 for uC/OS-II and avr-gcc 3.x
--------------------------------------------------------
If you have version 2.52 of uC/OS-II (the one which comes with the book)
or any version other than 2.70, see notes at the end of this document!
This is a test and example program to be used with uC/OS-II version
2.70, Atmel's ATmega 128 and avr-gcc version 3.x. There is a simpler
example program in the directory ex2. This example is a modification
of the example #1 in Labrosse's book. The modifications to AVR were
originally made by Ole Saether for the IAR compiler and ported to gcc
version 2.95 by Jesper Hansen. I have made a number of changes to the
program including, but not limited to:
- ISR programming is done using a macro UCOSISR(), which is
defined in avr_isr.h (by me). avr_isr.h is included in the port.
- ISR code is changed a bit to conform to the requirements of uC/OS-II
as documented by Labrosse's book. The general structure of an ISR
using my macros is
UCOSISR(validsignalname)
{
PushRS();
OSIntEnter();
if (OSIntNesting == 1)
OSTCBCur->OSTCBStkPtr = (OS_STK *)SP;
/* Do what you want the ISR to do */
sei();
OSIntExit();
PopRS();
}
UCOSISR() is used instead of macros SIGNAL() and INTERRUPT() from
avr-libc. DO NOT use SIGNAL() or INTERRUPT() with uC/OS-II, since they
save only the used registers on the stack, whereas uC/OS-II requires
that all the registers are saved. If a task switch is needed after or
during the ISR, the context of the current task will be trashed the
next time it is run. You can use SIGNAL(), since it does not enable
interrupts during the ISR, but then you MUST NOT use any of the
services provided by uC/OS-II. Thus, if you must e.g. signal a task
using a semaphore, UCOSISR() is the only way to do it.
- PushRS() and PopRS() are also macros provided by avr_isr.h. They
push and pop all the registers to or from the stack.
- sei() is a macro provided by avr-libc (by including
avr/interrupt.h). SP (stack pointer) is also provided by avr-libc in
avr/io.h (or the correct io*.h file included by avr/io.h)
- I use UART Data Register Empty Interrupt instead of UART Transmit
Complete Interrupt. The main part of the ISR is thus changed a bit and
PutChar also.
- I/O-ports are accessed using the now preferred syntax, e.g.
TCCR0=0; /* before: outb(TCCR0,0) or outp(0,TCCR0) */
UCSR0B &= ~_BV(UDRIE0); /* before: outb(UCSR0B,inb(UCSR0B) &~ (1<
近期下载者:
相关文件:
收藏者: