AWC GP3 Скачать руководство пользователя страница 21

least significant bit of the duty cycle. Send the duty cycle as the second byte. The duration/frequency is in ARG.

led – 

This property allows you to turn the onboard LED on or off. 

Raw command: 0 0 0 0 1 1 0 X where X=0 to

turn LED off and X=1 to turn LED on.

count

 - The count command allows the GP3 to count the number of low to high pulses that occur on an input 

pin over a particular period of time. This is not the hardware counter, but instead requires the GP3 to watch the 
input pin (the pin is forced to be an input). The duration (the argument when using raw commands) is specified 
in milliseconds. The GP3 samples the pin every 4uS for that period and returns the count as a 16-bit integer 
(most significant byte first). 

Raw command: 0 1 0 0 P P P 0 where P P P is the pin number.

rctime –

 This command allows the GP3 to measure the time a pin (forced to be an input) stays in a particular 

state. This is useful for measuring the charge or discharge time of an RC network (which can be used to 
measure a potentiometer or a thermistor, for example). The time returned (a 16-bit integer with most significant 
byte first) indicates the time in 2uS units. 

Raw command: 0 0 0 0 1 1 1 0, 1 0 1 0 P P P S where P P P is the pin 

number and S is the desired state.

pulsein – 

Use this function to read a single pulse on one of the 8 digital I/O pins (the pin is made an input). The 

return value (16-bits, most significant byte first) is in 2uS units (e.g., a return value of 100 indicates 200uS). 
The state argument indicates if you want to measure a low pulse (0) or a high pulse (1). If there is no pulse 
within 131.07mS, the command times out and returns 0. 

Raw command: 0 1 1 1 P P P S where P P P is the pin 

number and S is the pulse state.

pulseout – 

Generate an output pulse on one of the 8 digital I/O pins (the pin is made an output). The duration 

(in 2uS units) uses ARG in raw command mode. The pulse is formed by inverting the current state of the output 
pin for the time specified. 

Raw command: 0 1 0 0 P P P 1 where P P P is the pin number.

freq – 

This command generates a simulated sine wave (using PWM) on one of the 8 digital I/O pins. The 

duration is specified in milliseconds and the frequency in Hertz. For raw commands, ARG indicates the duration
in milliseconds. The frequency in Hertz (up to 32767) is sent as two bytes. The first byte is the most significant 
byte with bit 7 set (the GP3 ignores this bit). The second byte is the least significant byte shifted right one place 
and also with bit 7 set. The L bit is the least significant bit of the least significant byte. 

Raw command:  0 0 0 0 

1 1 1 0, 1 0 0 0 P P P L where P P P is the pin number and L is the least significant bit of the frequency's least 
significant byte.

setcounter

 – The GP3 has a hardware counter. This command sets the mode for the counter. In particular, you 

can select a prescale factor of 1, 2, 4, or 8. You can also select the internal 5MHz clock as a counter source (set 
the mode=0 for internal clock). The counter is 16-bits, so at 5MHz and a prescale of 8, for example, it rolls over
at roughly 105mS. When counting external pulses, the hardware counter counts high-going pulses. When using 
the library, simply specify the prescale number (e.g., 8). Setting the counter resets the count to zero. 

Raw 

command:  0 0 0 0 1 1 1 0, 1 0 0 1 0 V V X where  V V is the prescale factor (0 0 = 1:1, 0 1 = 1:2, 1 0 = 1:4, 1 1
= 1:8).

counter – 

This command reads the current counter value and resets the counter to zero. The 16-bit result is sent 

most significant byte first. 

Raw command: 0 1 0 1 1 0 1 0.

resetall – 

Use this command to return the GP3 to its initial state (all digital I/O as inputs, counter off and reset, 

PWM off). 

Raw command: 0 1 0 1 1 1 0 0.

repeat – 

You may wish to repeat certain input operations as rapidly as possible. If this is the case, set ARG to 

-18-

Содержание GP3

Страница 1: ...GP3 PC Analog Digital I O Kit 2010 2015 by AWC All Rights Reserved AWC http www awce com v1 6 15 April 2015 For the latest documentation see http www awce com doclib htm gp3 ...

Страница 2: ......

Страница 3: ... Compatible Notes 7 Arduino Compatible Notes 7 GPMPU28 8 GPMPU28 Parts List 8 GPMPU28 External Connections 8 GPMPU40 10 GPMPU40 Parts List 10 GPMPU40 Connections 11 GPMPU40 Edge Connector 12 Final Checkout 13 Software 13 Reference 16 Quick Reference 20 Additional Prototype Space Wings 21 Specifications 22 Schematic GP3X 23 Schematic GPMPU28 24 ...

Страница 4: ...ts nearly anywhere Convenient to plug into a solderless breadboard 2 The GPMPU40 Larger and more customizable than the GPMPU28 Simple to plug into a solderless breadboard or connect in a fixed installation 3 The GP3X This board offers the ultimate customization capabilities for the GP3 There are 6 sections on any GP3 system CPU The CPU chip contains the firmware and memory for the system Note that...

Страница 5: ...kit IC3 7805 not included with USB kit IC4 USB cable or daughter board UB232R If daughterboard used includes two 4 pin socket strips and is usually mounted on bottom side of board If not used IC4 can be used for other purposes see options J1 J2 Connectors on 2 centers usually installed on bottom of board but may be installed on top if preferred see options Standard kit comes with pin headers which...

Страница 6: ...r there are several options available First you can rewire the port so it selectable between DTE and DCE Near J3 there is a 2x4 pin header marked DTEDCE The PC board has traces running across the pins You can carefully remove the traces between each of the four pairs of pins using a hobby knife or razor the traces are on the top side of the board the side with the silk screen markings Then you can...

Страница 7: ...ghter board is installed under the board the pin numbers are reversed That is pin 1 of the module corresponds to IC4 pin 8 and the module s pin 8 will connect to IC4 pin 1 With the USB port on the underside of the board it is usually a good idea to use spacers or bolts in the four corner mounting holes to form feet for the board so it does not rest on the USB interface The connections between the ...

Страница 8: ...ult the GP3X kits however have a 5mm tact switch that can install in the holes pins 1 and 3 to provide a true reset switch Interface The primary external access to the board s functions is via J1 and J2 The markings on the board explain what each pin does The 4 corners marked with are ground points There is another ground on J1 right after the analog channels The analog channels are marked A0 to A...

Страница 9: ...st to install first Then you can install discrete components like the smaller capacitors resistors and LEDs Large components like the connectors C6 and IC3 should be installed last Construction Notes If your kit is supplied with two 24 pin 1 inch headers simply remove every other pin with pliers so that the headers fit in the J1 and J2 slots C1 C4 have polarity markings but it is not necessary to ...

Страница 10: ...can do this via the 2 pin header installed or the screw terminals as you prefer if you plan to only use the screw terminals you don t need to install the two pin header Connect the PI s P1 8 pin to the GP3X TTLSER pin 3 and P1 10 to TTLSER pin 4 This enables serial communications with the Pi The serial port on the Pi is used as the system console This has to be disabled in order to free the port f...

Страница 11: ... header for reset jumper Vin Gnd 9V battery snap The board requires no modifications to work with the GP3 However you may want to consider any special power supply connections or serial connections you d like to make In addition you ll need to connect the outside world to the GP3 as appropriate for your situation If you are prototyping you may want to install the header at JP1 and use it to connec...

Страница 12: ...ole Although it is customary to put the body of the resistors in the hole that has the white circle around it putting one in backwards will not affect circuit operation Also it is customary to put the ceramic resonator or crystal so that the markings face away from IC1 but putting it backwards will not affect circuit operation Normally C1 C4 are not polarized capacitors However if you use polarize...

Страница 13: ...n header for reset jumper Pgm Run not marked 3 pin header and jumper Vin J2 9V battery snap or optional coaxial power jack The GPMPU40 board is not specifically designed for the GP3 it is simply a general purpose board and you can read more about it in the GPMPU40 manual see http www awce com doclib htm GPMPU40 The goal is to essentially duplicate the GP3X or GPMPU28 schematics at the end of this ...

Страница 14: ... Required IC2 10 CLK hole not used by IC2 9 Required JP1 14 LED long lead Optional JP1 15 LED short lead Optional IC2 15 IC2 26 1K resistor Optional used with normal LED IC2 15 Ground any hole Optional used with 5V LED JP4 26 Ground any hole Optional used with normal LED IC2 29 T Required IC2 30 R Required IC2 31 Ground any hole Required IC2 32 Vcc Required IC2 34 r Required IC2 35 t Required JP7 ...

Страница 15: ...M output 14 Onboard LED output 27 Digital I O 1 28 Digital I O 2 29 30 Must be disconnected serial I O 31 Ground 32 5V 33 Digital I O 0 34 35 Must be disconnected serial I O 36 Digital I O 3 37 Digital I O 4 38 Digital I O 5 39 Digital I O 6 40 Digital I O 7 You can use the extra pins in the IC2 foot print to mount an op amp MCP602 is optionally supplied note the MCP602 is designed to operate off ...

Страница 16: ...ble and the appropriate COM port Once these checks are complete or you are feeling lucky you can fit a jumper on the Pgm Run header so that the center pin connects to the pin closest to the word Run on the GP3X For the GPMPU40 the jumper at JP7 should have a short between JP7 2 and JP 3 For the GPMPU28 connect JP1 3 to the 5 volt supply pin JP1 11 for example Install IC1 and power up the board The...

Страница 17: ...anguages Very simple to use ActiveX not portable Must have correct MS dependencies This page has more info see below Core installer has ActiveX and standard DLLs Example with VB Express Windows DLL or Library Standard library can produce a standard library a DLL or you can just include the source code in your C or C program Portable same code usable on Linux Windows Cygwin Windows CE DLL usable wi...

Страница 18: ...mbas Linux Gambas is a VB like RAD tool for Linux that supports the GP3 Easy visual development Linux only Gambas Example GNUPlot Linux This article shows a simple way to stream data from a GP 3 to GNUPlot No real programming flexible and easy Linux only not the fastest solution GNUPlot Example Arduino Libraries to interface the GP3 A to Arduino Works with any GP3 board if interfaced to Arduino In...

Страница 19: ...n addition there is a 16 bit argument ARG that can be set by special commands Some commands use this argument word as an additional source of data When the GP3 sends data to the PC it is not encoded in any particular way since the GP3 only responds to queries from the PC there is no chance of desynchronizing All data back and forth is in binary although the results from a raw inp command happen to...

Страница 20: ...ication The cselect argument can be 0 1 or 4 The default 0 uses ground and the supply voltage as references A value of 1 selects analog input 3 as the positive reference the negative reference is still ground in this case A value of 4 uses analog input 2 as the negative reference and analog input 3 as the positive reference This is useful for expanding the sensitivity of the A D converter So using...

Страница 21: ... is made an output The duration in 2uS units uses ARG in raw command mode The pulse is formed by inverting the current state of the output pin for the time specified Raw command 0 1 0 0 P P P 1 where P P P is the pin number freq This command generates a simulated sine wave using PWM on one of the 8 digital I O pins The duration is specified in milliseconds and the frequency in Hertz For raw comman...

Страница 22: ...k This function returns TRUE if the GP3 is responding errflag If an error occurs this flag will be set to true readbyte Reads a byte from the GP3 This is useful when using a repeating command that returns bytes readword Reads a word from the GP3 This is useful when using a repeating command that returns words Direct only Commands There are several commands the GP3 recognizes that are not exposed b...

Страница 23: ...WM for specified duration Automatically makes pin an output count pin duration word Counts pulses on specified pin for duration in mS or 2mS for Pi Automatically makes pin an input rctime pin state word Measures time pin stays in state 2uS resolution 4uS for Pi Automatically makes pin an input pulsein pin state word Measures pulse 2uS resolution 4uS for Pi Automatically makes pin an input pulseout...

Страница 24: ...se wings you will order the GP3 X with pins instead of screw terminals The pins will mount on the bottom of the PCB so you will solder them from the top Then you can solder the wings to pins on the sides you want to add prototyping space While you can put them anywhere it is best to put the pins in the edge of the first group of 4 holes in a row the breadboard holes The pins will consume one colum...

Страница 25: ...ut low voltage maximum 0 8V Input high voltage minimum 2 0V Input leakage current maximum 1uA Output low voltage maximum 0 6V Output High voltage minimum Vdd 0 7V EEPROM endurance minimum 100 000 write cycles A D resolution 10 bits A D Integral error 1LSB A D Differential error 1LSB A D Offset error maximum A D Vref minimum 2 7V Recommended analog input impedance 10k ohm Vref input current maximum...

Страница 26: ...Schematic GP3X 23 ...

Страница 27: ...Schematic GPMPU28 24 ...

Отзывы: