Home
µChameleon User`s Manual
Contents
1. 1 7 Testapplication uChameleon control 1 7 1 Overview On the install cd you received with your Chameleon also available as a download on our web site you will find an utility called uChameleon control that lets you perform simple tests with a graphical user interface and that allows you to exert all the features of the Chameleon as well as show you it is properly connected if multiple Chameleons are connected to your computer you will be able to select the one you want to talk to Another interesting feature is that for every action you perform in the user interface the software shows you the command string that is sent to the uChameleon along with the response if applicable so you can learn along the process making for a very short learning curve In a few minutes you ll understand how to perform most of the tasks in your own applications Additionally an entry box will let you type random commands that will be sent as is to the wChameleon again showing the eventual answer To install this software simply launch the setup exe in the uChameleon control under Utilities directory of the install cd or grab it on our downloads page on our web site 1 7 2 Automatic device detection The frame called Device selection will show all uChameleon devices connected to your computer and allow the selection of the device you want to talk to Of course if a single device is detected it will be the
2. default selection Copyright 2006 2008 Starting Point Systems Page 6 firmware rev 3 0 uChameleon User s Manual 1 7 3 Activity led toggling Two buttons labelled led on and led off will turn on and off the activity led beside the usb connector of the uChameleon This is one of the simplest things you can do with it Additionally you can use an 8bits word as a sequence for flashing effects quickly showing a simple state information without looking at the computer screen Try typing the following command led pattern 5 and press enter You should see the led moslty off with 2 brief flashes To revert to default state send led pattern 254 1 7 4 Digital I Os panel This panel shows a representation of the Chameleon where every connector has two clickable items One is a square box with a letter I or O and sets the direction on the pin as input or output respectively The other mimics a led and will show the state of the pin When programmed as an input it will be light or dark green corresponding to the high and low state respectively When programmed as an output the colours will be light and dark red indicating a high or low output 1 7 5 Direct command input This entry box allows you to directly type commands with your keyboard and send it to your Chameleon The command is displayed in the logging text box as well as the answer if applicable Check boxes allow you to select the typ
3. become 70 Normal polarity default pwm lt n gt polarity 0 pwm lt n gt pol 0 Inverted polarity pwm lt n gt polarity I pwm lt n gt pol I Note pwm channels 9 and 10 as well as 11 and 12 share their clock so you can easily generate complementary signals by programming two channels identically and just inverting the polarity of one of then Copyright O 2006 2008 Starting Point Systems Page 14 firmware rev 3 0 uChameleon User s Manual 1 12 7 Pwm prescaler The period and width parameters of the pwm feature are expressed in terms of cycle counts with a default frequency of 1OMHz that is a resolution of 100ns This means that the minimum possible frequency is about 153Hz It is also possible to prescale the clock of pwm channels by the following amounts 1 2 4 8 16 32 64 Default 1 pwm lt n gt prescaler lt p gt pwm lt n gt pre lt p gt Copyright O 2006 2008 Starting Point Systems Page 15 firmware rev 3 0 uChameleon User s Manual 1 13 Variables and arithmetic 1 13 1 Dim The dim statement create a new variable stores its name and type and allocates memory for it The variable name and type are stored permanently in the flash memory but the value is not retained when power is lost Syntax dim lt varname gt as lt type gt Example dim myvar as int Notes It is possible to define up to 32 variables Variable names may have up to 12 characters Only the int ty
4. lt n gt mon on I Deactivating pin monitoring pin lt n gt monitor off 0 pin lt n gt mon off 0 When pin monitoring is active the Chameleon will constantly check for transitions on the selected pin and report once per transition by sending the same string that would be returned by the pin lt n gt state command For example if you when to monitor pin 3 you will send pin 3 monitor on and whenever a low to high transition will be detected you will receive pin3 1 or when a high to low transition happens you will receive pin3 0 Pin monitoring is supported by all 18 pins and can be active simultaneously on any pins combination Copyright 2006 2008 Starting Point Systems Page 11 firmware rev 3 0 uChameleon User s Manual 1 11 Analog inputs 1 11 1 Reading pin voltage Read voltage on pin n adc lt n gt gt adc lt n gt lt v gt Pins to 8 support the analog to digital conversion of a 0 5volts input to a single byte The firmware always responds by repeating the adc lt n gt this allows easy and unambiguous demultiplexing without waiting for answers each time a command is sent The lt v gt value will be in the range 0 255 with 0 for Ovolts and 255 for 5volts 1 12 Analog outputs PWM Frequency generation 1 12 1 PWM applications The four timer channels of your UChameleon can be used to output signals of controlled frequency and duty cycle and each of them can be used for a
5. state corresponding to the state of a bit in the parameter byte For example if you want the led to be mostly off with 3 small flashes the parameter value can be 21 1 4 16 Try by sending ed pattern 21 1 10 Digital inputs outputs 1 10 1 Setting pin direction Setting the n pin as an input pin lt n gt input pin lt n gt in Setting the n pin as an output pin lt n gt output pin lt n gt out Copyright O 2006 2008 Starting Point Systems Page 9 firmware rev 3 0 uChameleon User s Manual 1 10 2 Reading pin state Reading the n pin state pin lt n gt state gt pin lt n gt 0 I 1 10 3 Setting pin state Setting the n pin high pin lt n gt high pin lt n gt hi Setting the n pin low pin lt n gt low pin lt n gt lo 1 10 4 Activating pin pull up Activating pull up on pin n pin lt n gt pullup on pin lt n gt pullup I Deactivating pull up on pin n pin lt n gt pullup off pin lt n gt pullup 0 Note The pull up feature is supported only on pins 9 to 16 The typical pull up resistor value is around 47kOhms Copyright O 2006 2008 Starting Point Systems Page 10 firmware rev 3 0 uChameleon User s Manual 1 10 5 Monitoring pin activity This is an alternative method to monitor pin states without having to use a timer in your pc application to periodically poll for the state of pins Activating pin monitoring pin lt n gt monitor on I pin
6. variety of purposes including generation of analog voltages A simple R C filter will generate a clean linearly varying analog voltage and by changing this voltage at regular intervals it is also possible to generate arbitrary waveforms This makes it very simple to generate a programmable control voltage for example the output voltage of a programmable power supply the frequency or a vco in short anything that can be controlled with an analog voltage Is is also possible to use the pwm outputs without any filtering the pwm output connected directly for example to control the brightness of a led of driving a power transistor or bridge controlling the speed and direction of a de motor Copyright 2006 2008 Starting Point Systems Page 12 firmware rev 3 0 uChameleon User s Manual 1 12 2 PWM commands summary Here is a summary of the available commands pwm lt n gt on pwm lt n gt off pwm lt n gt period pwm lt n gt width pwm lt n gt polarity pwm lt n gt prescaler The following sections give details on using these commands Note these features are available on pins 9 10 11 12 1 12 3 Pwm channel on or off Turn on the pwm feature on pin n pwm lt n gt on Turn off the pwm feature on pin n pwm lt n gt off Note these commands can be sent only once at the beginning and end of an application although it can be a good idea to set various parameters like period and width before turning t
7. e of string termination used Copyright 2006 2008 Starting Point Systems Page 7 firmware rev 3 0 uChameleon User s Manual 2 Programming reference This section describes all commands supported by the Chameleon firmware current version is 2 1 It is possible to try issuing commands as a learning exercise by using the uChameleon control application Actions in the graphical interface will also show in the log text the command corresponding to each action and that was actually sent It is also possible to type commands by hand in the direct command input box Note In the rest of this manual when we talk about sending a command we mean that the corresponding string is sent followed by a LineFeed or CarriageReturn or Cr Lf combination Note Commands to be sent will be shown in italics like this ed on as well as replies 1 8 Communication basics Depending on your preferences there are two ways to talk to the uChameleon The simplest that will cover most needs uses the Virtual Com Port that means that everything happens like if you where talking to a device connected to a legacy serial port on your pc Most programming environments will support that feature either through built in functions or the win32 api The second way is to use a more direct access using the provided D2XX dll which can provide higher throughput and easier multiple devices support Of course it s possible to start w
8. ear 5Volts regulator Copyright 2006 2008 Starting Point Systems Page 21 firmware rev 3 0 uChameleon User s Manual 2 2 3 Using an external wall mount transformer Simply connect a standard wall mount transformer with a typical output voltage between 9Volts and 12 Volts to the black connector beside the usb connector The external voltage will be internally regulated to a clean 5Volts and the uUChameleon will switch from USB power automatically 2 2 4 Thermal considerations When powered by an external transformer the region near the power connector can feel warm to the touch This is normal However it is suggested not to apply more than 16 Volts to the external power input especially at high currents as this will increase the heat produced by the internal linear regulator Copyright 2006 2008 Starting Point Systems Page 22 firmware rev 3 0
9. he pwm on 1 12 4 Pwm output frequency Set the signal period of pin n pwm lt n gt period lt p gt pwm lt n gt per lt p gt The period parameter is in timer clock cycle units with a range 0 65535 Nominal frequency is 10MHz For example pwm 9 period 1000 will program the timer channel on pin 9 for a 10kHz frequency Note this is true unless you have prescaled down the clock input see prescaler section 1 12 7 Copyright O 2006 2008 Starting Point Systems Page 13 firmware rev 3 0 uChameleon User s Manual 1 12 5 Pwm duty cycle Set the signal duty cycle of pin n pwm lt n gt width lt w gt pwm lt n gt wid lt w gt The width parameter is in timer clock cycle units with a range 0 65535 For example if you want to generate a 30 duty cycle signal on pin 9 with a 10kHz frequency you will send pwm 9 period 1000 pwm 9 width 300 Also if you want to generate a variable frequency but with a constant 50 duty cycle the period being in a variable called myvar you will send pwm 9 period myvar pwm 9 width myvar 2 Note this syntax is a simplification because myvar and myvar 2 should be sent as string and because other commands might be necessary notably turning the pwm channel on if this is the first action 1 12 6 Pwm polarity It is possible to control the polarity of the logic level of a pwm channel which will affect the meaning of the width parameter a 30 duty cycle would now
10. ing customer input New firmware can be downloaded from our web site and with our simple Firmware Upgrader PC software the newest features are just a click away Additionally the hardware protected boot block cannot be erased accidentally meaning you cannot end up with a locked Chameleon If something fails during upgrade simply try again 1 5 External connectors The external connectors provide 18 I O pins All of them are individually programmable as digital inputs or outputs and their state can be read or set Additionally some of them have specialized functions for use as analog inputs analog outputs frequency generation pulse width modulation These special purpose pins are indicated on the label of your uChameleon as a quick reference when connecting to external devices Here is a summary of these special function pins spi 13 to 16 Note spi and uart are not yet officially supported please contact us for beta test firmware if necessary Copyright O 2006 2008 Starting Point Systems Page 5 firmware rev 3 0 uChameleon User s Manual 1 Getting started 1 6 Device driver installation When you first connect your UChameleon to your computer you will be prompted for a driver Please insert the installation disk provided with the uChameleon and choose the appropriate directory where the driver is located For example Drivers Win2k XP 2 00 00 if you use Windows 2000 or Windows XP See section 1 1
11. ions or procedures in most programming languages except they don t take parameters There are currently two defined events reset and background 1 15 2 The reset event As the name implies the reset event occurs once at power up and every time the uChameleon is reset either via software by pressing the reset button or when power is cycled 1 15 3 The background event The background event is a periodic event triggered by an internal oscillator running at approximately 20Hz It can be turned on or off default after reset is off Syntax for turning on the periodic event generator background on back on Syntax for turning off the periodic event generator background off back off Copyright 2006 2008 Starting Point Systems Page 19 firmware rev 3 0 uChameleon User s Manual 1 15 4 Defining event handlers Syntax for defining event handlers onevent lt event name gt lt instruction line 1 gt lt instruction line 2 gt lt instruction line n gt endevent Example onevent reset pin 2 output background on endevent onevent background adc I if gt 135 then pin 2 low if lt 126 then pin 2 high endevent Note The preceding example show how simple it is to implement a simple standalone temperature controller with hysteresis Copyright 2006 2008 Starting Point Systems Page 20 firmware rev 3 0 uChameleon User s Manual 2 Hardware Information 2 1 Input
12. ironment that can send text strings to a COM port will know how to talk to the Chameleon You can even perform simple tests with your favourite terminal emulator The second way is through a DLL library that replicates the classical Win32 API and provides for higher bandwidth and more flexibility especially if you are planning to manage multiple Chameleons connected to a single computer Windows XP Windows Server 2003 and Windows 2000 drivers support a Combined Driver Model that allows both alternatives provided they are not used simultaneously Windows 98 and Windows Me have one driver that supports the VCP model and another one that supports the DLL and will have to be chosen at driver installation Copyright 2006 2008 Starting Point Systems Page 4 firmware rev 3 0 uChameleon User s Manual 1 3 Command interpreter The firmware inside your uChameleon runs a command interpreter that understands full text commands that let you access all of its hardware resources The small command set was optimized to provide what is necessary for addressing real world applications It hides all the messy details so you can focus on end application and makes for a short learning curve No more complicated API that is difficult to learn with lots of mandatory parameters and subtle and hard to distinguish variants 1 4 Firmware upgrades We constantly work to improve the possibilities of the uChameleon and provide new features follow
13. nere ennen 20 2 Hardware Information sroreronnrvvrronnvnrrrnnnrnrrrrnnvnrrrnnrnversnnrnvsrssnnsene 21 2 1 Inputs NS 21 2 2 Power supply circuitry RE NE een entre te rr kr seere rr ternene 21 2 2 1 Power circuitry OVerview css cassanessesnccsereconaadsntapwureacenansasusvesiiaveneatdesanensdenuapeaviers 21 LAMA Power Ce k Legssmeemsnsgadunedkalagnolsdnsmmeenle 21 2 2 3 Using an external wall mount transformer sronvrrnnrnrnrrennrrrnrnrrrrernsrensrernnernn 22 2 2 4 Thermal considerations tz ekoch oaadk ca Aha o z obden zac Anka odsk ce 22 Copyright 2006 2008 Starting Point Systems Page 3 firmware rev 3 0 uChameleon User s Manual 1 General overview 1 1 Features summary Full speed USB 2 0 communication bandwidth 1Mbytes s Drivers available for Windows 98 Me 2000 XP Vista Linux MacOS Embedded command interpreter Autonomous operation 18 general purpose digital I Os 4 timer channels with pulse width modulation 8 analog inputs Powers from USB or wall mount transformer switches automatically Screw connectors to quickly connect your external circuits Compact size 1 2 USB communication drivers There are two main ways to communicate with your uChameleon The simplest way is through the Virtual Com Port or VCP driver interface where the drivers will emulate a legacy serial port The port will appear under your COM and LPT ports of the control panel Any existing software or programming env
14. nssnnesenvesennesennenense 9 1 10 1 Setting pin direction RR R 9 1 102 Fs 10 1 10 3 Setting EE EE EE Bilabdu osada E d lna da bs ERREA 10 1104 eve pin p ll Up sirener esserne eders E ER 10 1 10 5 Monitoring PFG Gabe 11 LL Analog Navet 12 LILL Reading pi voltagc senene e bod dla sos E EEA 12 1 12 Analog outputs PWM Frequency generation 12 1 12 1 PWM applications eek 12 1122 PWM commands summaty s issisissriiiisiiiiirniisriiiioiisriniin siniori sieisen 13 1125 Pm channel onor offenem oeenn E E E EERE 13 1 12 4 Pwm output frequency ssccecnsssacessurvecasusesacenentnccasaipeatsnmnensiosed ales ane tade 13 1 12 57 Pwm duty cycle APS 14 1126 Pwmpol rity 2 4 rue naea E E E E EEE 14 1127 PNG PES JOE ERE 15 1 13 Variables and arithmetic aai ededdeekdminddmnen 16 I 1 e 20 B RN B i a a ESO R O O O O A 16 1152 Leton an E E E E E EE EEES 16 1 13 3 Increment and decrement 5 sicescuvenecsvensonsectaneneensnsencanstazacndacnincesncexineatantencebnaes 17 MS 17 11355 1167 special Varia le siiis eseon eE E EE ENEE 17 1156 F les vessrmesmenmesassmsemttnedunssnseanejkuduisnn 17 Copyright O 2006 2008 Starting Point Systems Page 2 firmware rev 3 0 uChameleon User s Manual 1 14 Conditional execution vvarapaem knea 18 1 14 1 If then and relational PE ON ves ANG 18 L15 Fedre 19 P Po 0 PORS 0100511019000 O E EREE 19 1 132 Tee 19 28 The background event sss eneboere albedo 19 1154 Defining event handlers 45432 roere
15. pe 16 bit integer is defined in firmware 3 0 1 13 2 Let The let statement assigns a value to a variable the right side of the equal sign being either a single variable or constant or an arithmetic operation combining two variables or constants Syntax let lt variable gt lt value gt let lt variable gt lt value gt lt operator gt lt value gt Examples letx 0 let counter counter 3 let speed speed accel Available operators operator arithmetic performed addition subtraction i multiplication division modulo Copyright O 2006 2008 Starting Point Systems Page 16 firmware rev 3 0 uChameleon User s Manual 1 13 3 Increment and decrement Instead of writing let var var I One can write increment var Or incr var Instead of writing let var var I One can write decrement var Or decr var This is generally more convenient results in more compact code and is also faster 1 13 4 Print It is possible to query the value of a variable with the print statement Syntax print lt varname gt This command will send the variable content to the USB communication port 1 13 5 The special variable Some former commands like adc or pin have their last value stored in a special variable that can be accessed with the sign Example adc I let voltage the voltage variable that we suppose was created pre
16. riting applications using the COM port interface and migrate later to the direct interface Most of the sample code you ll find on our site or this documentation was developed using this approach Although most programming examples will be provided using Visual Basic style it is generally straightforward to translate them to other programming languages 1 8 1 Opening communication Before actually sending commands it s necessary to open the communications port and this will depend on your programming environment but in Visual Basic would simply be MSComm1 PortOpen True 1 8 2 Checking for device presence Although it is not necessary you might want to check if your uChameleon is functioning properly and ready to accept commands It can be done by sending id which the device should respond to by returning id uChameleon Copyright 2006 2008 Starting Point Systems Page 8 firmware rev 3 0 uChameleon User s Manual 1 9 Activity led Besides the USB connector of the uChameleon there is a led that turns on at power up with a small off flash indicating the firmware is up and running and waiting to receive commands It is also possible to act on this led by software 1 9 1 Turning the led on or off Turing the led on led on led 1 Turn the led off led off led 0 1 9 2 Setting a led flashing pattern led pattern lt n gt The led can be driven by a sequence of 8 on and off states each
17. s Outputs All inputs are very high impedance CMOS inputs typically greater than 10Mohms All I Os are protected with 100Ohms current limiting resistors This enables a direct connection to LEDs opto couplers power transistors miniature relays piezo buzzers small loudspeakers with a typical current output of 20mA 2 2 Power supply circuitry 2 2 1 Power circuitry overview Powers from USB Powers from wall mount transformer Powers from local regulated 5 Volts Switches automatically between its power sources Provides power to your external circuitry Multiple protection schemes ensure high reliability The power circuitry of the Chameleon is extremely flexible and has been designed to adapt to as many real world situations as possible First it can be powered directly by the USB port of your computer which is the default configuration most users are satisfied with In some instances however for example when using an bus powered hub that is not capable of providing enough current or to conserve the battery of a laptop or to get an accurate 5 Volts level for some analog applications the uUChameleon has an internal linear regulator 2 2 2 Power circuitry protections The power circuitry is protected against the following situations Polarity inversion of wall mount connection Board power short circuit Current consumption over 500mA protects your computer Over temperature of power switch Over temperature of lin
18. uChameleon User s Manual uChameleon User s Manual Firmware Rev 3 0 Copyright 2006 2008 Starting Point Systems Page firmware rev 3 0 uChameleon User s Manual le Ga EE NE NE bededag 4 Li Features summar ye senere aa aa 4 1 2 USB communication drivers eesovernnorennnrennnvrennvsennnrennnveennsesnsvsrnnnssnnssenne 4 1 3 Command interpreter MR O een O O 5 1 4 Firmware upgrades saa 5 1 5 External connectors Varen ke 5 l GEN 6 1 6 Device driver installation varar sanke retn er tr sete rrrrsrnrnee 6 1 7 Test application wChameleon Control eee 6 1 7 1 OVESTVIEW EE NO ak 6 1 7 2 Automatic device deterionuuonmsnennssnanspuitetnmnsimdnomeninte 6 1 7 3 Activity led TN Lean 7 LFA Digital VOs Hae EEE bondens 7 175 Diteet command f ics sacs sascodissosiicieediantevedieaccsastaterdnlncuimodaenuncisomatingss 7 2 Programming reference u sssssseveereeereesn treere enes en kerereeee 8 1 8 Communication basics sssssserseeseserer renen renser sende 8 1 8 1 Opening communication umgngnmmivevneinGeerianmienesn 8 1 8 2 Checking for device presence z zssis adtakabo sto renee rren eee rene nen renerne tree 8 19 Activity Eve 9 1 9 1 Turning the ed 000 oasis omnia os emacs 9 1 9 2 Setting led flashing pattern lt lt snsacasccvcnsdacvannnsccasenntcccasesssacnnansnetevansieccnuntenennenssncvie 9 1 10 Digital inputs outputsS ssoroorrronnrrronrrrorrrsnnvrsenrrrnnv
19. viously with dim now contains the result of the last analog to digital conversion Note the sign can be used in any place a variable or constant would be used 1 13 6 Erasing variables It is possible to erase all variables and their definitions as well as freeing the memory they use with the erase command Syntax erase dims Copyright 2006 2008 Starting Point Systems Page 17 firmware rev 3 0 uChameleon User s Manual 1 14 Conditional execution 1 14 1 If then and relational operators If statements provide the ability to conditionally execute commands based on comparison between values The general form it takes is the following if lt value A gt lt operator gt lt value B gt then lt command gt The value parameters can be any variable or constant The operator can be any of the following operator comparison performed equal to lt gt not equal to gt strictly greater than gt greater or equal lt strictly less than lt less or equal Examples if counter gt 1024 then let counter 0 if voltage lt 128 then pin 3 low if alert 1 then led pattern 5 Copyright 2006 2008 Starting Point Systems Page 18 firmware rev 3 0 uChameleon User s Manual 1 15 Event handlers 1 15 1 Introduction Event handlers provide a way to store a list of instructions to be executed when a specific event occurs They are similar to funct
Download Pdf Manuals
Related Search
Related Contents
Concepts In Wood DR30-D Instructions / Assembly PDF形式 2684KB Care and Maintenance Manual Samsung SPF-85P User Manual フローズンマシン mini-1/mini-2取扱説明書 Preguntas frecuentes T930 L011-40 Rev F0.pub Samsung GT-E1150I Felhasználói kézikönyv NEC M322H SAP Printing Application Note Copyright © All rights reserved.
Failed to retrieve file