AVR-CDC-IO.pdf

(511 KB) Pobierz
AVR-CDC-IO
1 z 4
Virtual COM Port over Low-Speed USB
AVR-CDC
Home About CDC-232 CDC-IO CDC-SPI Driver Download FAQ Reference
>
About
CDC-IO
CDC-232
Usage
CDC-IO manipulates the AVR's Special Function Registers (SFR) through a virtual COM port on PC. It enables
reading/writing the MCU's parallel port freely. With the operations of Timer/Counter, PWM, A/D Converter, or
EEPROM, PC application achieves an advanced control over the device.
Schematics
CDC-IO
Usage
Schematics
Sample Program
CDC-SPI
Usage
Schematics
Sample Program
The External Interface using Software-USB
Driver
CDC Protocol
Usage
Windows
Mac OS
The installation is the same as CDC-232. The baudrate is arbitrary. Send text style commands from terminal software
or from your application on PC. If you need faster data transfer, Use "lowcdc.vbs" to switch to the bulk transfer mode.
Linux
CDC-IO Instruction Set
FAQ
Device Recognition
Function Command Format
Response
Who
@ @
"cdc-io", CR-LF
Communication Problem
Get
? address ?
data, CR-LF
Set
= data address =
CR-LF
Others
AND & Set
& data address & CR-LF
OR & Set
| data address |
CR-LF
>
Download
EX-OR & Set ^ data address ^
CR-LF
Set Double
$ data2 data1 address $ CR-LF
ATtiny2313 version has "Set","Get","Xor" only.
>
Reference
address: memory mapped SFR address in hex
data: 8 bit data in hex
delimiter: Tab, Space, CR, LF
predefined addr: (case-insensitive, NOT supported at ATtiny2313)
PINB, DDRB, PORTB PINC, DDRC, PORTC PIND, DDRD, PORTD
Example: ('_' means delimiter)
DDRB_?_ Replies DDRB value with CR-LF.
12_34_=_ Write 0x12 to address:0x34, replies CR-LF.
FB_PORTC_&_ Write (PORTC & 0xFB) to PORTC, replies CR-LF.
(ATtiny2313)
36_?_ Replies PINB(0x36) value with CR-LF.
12_37_=_ Write 0x12 to DDRB(0x37), replies CR-LF.
FB_38_^_ Write (PORTB ^ 0xFB) to PORTB(0x38), replies CR-LF.
Previous data and addr can be reused. Just enter command char to repeat.
"Set Double" command is used to write into EEPROM.
Avoid changing the port bits shared with USB signals. Use '&', '|' or '^' to modify the port direction. Use PIN* to toggle
bits if the port is assigned to output.
While enabling interrupt, the interrupt vector number is reported when invoked.
413532854.004.png 413532854.005.png
2 z 4
Any SFRs are accessible. See AVR datasheet to use Timers, ADC, EEPROM, etc.
copyright (c)2011 Osamu Tamura @
Recursion Co., Ltd. All rights reserved.
Schematic s
If the Vcc of the target circuit is 5V and the AVR's port is configured as input, insert some registers (3K3-10Kohms) to
prevent backward current.
Use crystal oscillator. Although ceramic resonator works well in most cases, it becomes unstable if the frequency
deviation is bigger.
ATtiny45/85 uses internal RC oscillator and PLL. It is calibrated to 16.5MHz by the USB signal when connected.
CDC-IO for ATtiny45-20
CDC-IO for ATtiny461-20
Only the "Set", "Get" and "Xor" commands are implemented in ATtiny2313's limited memory. This version has no
interrupt-report mechanism.
CDC-IO for ATtiny2313-20
413532854.006.png 413532854.007.png
3 z 4
CDC-IO for ATmega8/48/88-20
Sample Program
These are the experimental circuit and the sample programs for ATmega8/48. These programs are written in C, VB,
VC, VC++, and C#. You can use any other languages (or macros) if they support RS-232C communication.
The volume control changes the buzzer tone and the LED's blinking pattern.
413532854.001.png
4 z 4
413532854.002.png 413532854.003.png
Zgłoś jeśli naruszono regulamin