Home
iProtoXi Firmware User Guide
Contents
1. Add Type R W Name Values purpose ress 00h byte R deviceAddress 80h identifies this device iProtoXi Master 01h byte R regsVersion 81h identifies this register set version 02h word R regsSize 0046h total size of this register set 04h byte R deviceState State of this device 0 stopped 1 running 05h byte RW deviceControl Write to control this device 01h reset to defaults 02h stop 03h run 06h byte RW debugLevel Debug messages 00h no 01h show all 07h byte reserved Reserved for future purposes 08h word R softwareVersion Version of iProtoXi Aistin firmware in hexadecimal e g 0080h equals to 0 8 0 OAh word R arduinoVersion Version of used Arduino build environment in hexadecimal e g 0104h equals to 1 0 4 OCh word R hardwareVersion Version of iProtoXi Micro board we are running on in hexadecimal e g 0120h means 1 2 0 OEh 6 bytes RW boardUID Six byte unique board identifier 14h 13bytes RW nodelD Null terminated board node identifier string 21h byte reserved Even byte alignment 22h byte RW i2cBaseAddress 00h offset for I2C addresses not implemented 23h byte RW virtuall2cBaseAddr 80h offset for virtual IC addresses not impl 24h long RW datetime Real time clock value is in seconds when read as hexadecimal binary For text format date and time read zero bytes instea
2. 1Ch word R analogInputs 11 Analog input value for channel 11 1Eh word R analogInputs 12 Analog input value for channel 12 20h word R analogInputs 13 Analog input value for channel 13 Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 15 EXAMPLE USE CASES gt r 810602 100m Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 16 VIRTUAL MACHINE REGISTER SET Software Device 8Dh Version 82h Virtual machine VM is a special device that can be used to run user s own program This register set is used to control the virtual processor In practice the needed operations are normally stopping and re starting execution of a loaded program See next section for information how to load a program for the virtual machine Add Type R W Name Values purpose ress 00h byte R deviceAddress 8Dh identifies this device Virtual Machine O1h byte R regsVersion 82h identifies this register set version 02h word R regsSize 003 1h total size of this register set 04h byte R deviceState State of the VM 0 stopped 1 running 05h byte RW deviceControl Write to control VM 01h reset 02h stop 03h continue 04h re start program 10h start programming 12h set autostart off 13h set autostart on 06h byte RW debugLevel Level of debug messages 00h no deb
3. D2 are data bytes that will be send into the device Da and written into the register Ra All numbers are in two character hexadecimal format in other words a value between 00 FF Thus a leading zero is required if the number is less than hex 10 Spaces are not allowed If the value of Nb is not zero but does not match to the given data an error is returned negative acknowledge If Nb is zero then any number of data bytes is allowed Leaving Nb away first form equals to setting it to zero Note that in case of 16 bit register address Nb must always be given Alternative formats for text type of data are as follows gt W DaRaSmy text 8 bit register address Nb is zero gt W DaRaNbSmy text 8 bit register address Nb given gt W DaRaraNbSmy text 16 bit register address Nb is always needed In this case the data to be written is given as a string and the number of bytes Nb is set to either zero or to match the length of the string In case of zero end of string is indicated with linefeed If protocol specific characters linefeed and single quote are included into the string Nb must be set to indicate the total length of the string Read R Read message gets one of the following forms gt R DaRa 8 bit register address Nb is zero gt R DaRaNb 8 bit register address Nb given Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 7 gt R DaRaraNb 16 bit register address Nb is always needed Again Da
4. 7 6 5 4 3 2 1 0 Purpose Op Operand Operand Operation code modifier type size Operation code bits define the operation in case for example addition or multiplication In most cases Operand size is set zero for byte sized operations and one for word sized The Operand type bit is mostly set zero if one of the operands is included as an immediate value and one if that operand should be taken from a RAM register instead Operation modifier is mostly used to select between unsigned and signed oprations The table below lists all available instructions Note that arithmetic instructions are currectly always producing saturated results in case of under overflow The supported instructions are described in the table below Following abreviations are used rd Byte value destination ram address rs Byte value source ram address Da Byte value destination device address Ra Byte value destination device register address Nb Byte value used as a number of bytes de Byte value message data encoding use 42h for text 03h for binary in hexadecimal b Byte value read as immediate value from code flow wt Word value two bytes read as immediate value from code flow jb Relative one byte jump address with special values 00h first TAG ffh previous TAG jw Absolute two byte jump address with special values 0000h first TAG ffffh previous TAG Mnemonic Code Operands Description hex readdev8 b 01 rd Ra Read a single byte from current d
5. an absolute value from a signed word mul b 17 rd b Multiply with immediate unsigned byte mul w 37 rd w Multiply with immediate unsigned word mul sb 97 rd b Multiply with immediate signed byte mul sw B7 rd w Multiply with immediate signed word div b 18 rd b Divide with immediate unsigned byte div w 38 rd wH Divide with immediate unsigned word div sb 98 rd b Divide with immediate signed byte div sw B8 rd wH Divide with immediate signed word tag 1D Mark a loop TAG for a program to loop later on setdev 1E b Set current device address Da setnode 9E rs Set target nodelD to a null terminating string stored at rs Following special values can also be used 00h loopback local reads writes default 01h allnodes reads writes to all nodes 02h allclients reads writes to all clients 03h vmowner reads writes to current VM owner This opcode may be replaced with other function in the future use only if absolutely necessary Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 24 SOME EXAMPLE PROGRAMS The following codes can be uploaded as such into the iProtoXi Micro CPU board from a terminal program using either copy paste or alternatively save example in a file and then upload that file It is convenient to use file extension ais in those files to recognize them later on After successful uploading start the virtual machine with a command gt w 8d05 04 restart VM To stop use
6. byte RW nonipxChannels Where to forward off message characters see commChannels for accepted values This can be used to communicate with e g a Bluetooth module 37h byte RW debugChannels Where to send debug printing not currently supported 38h bytes R scanForDevices Read to get list of available device addresses both real I2C devices and software devices will be listed 39h byte reserved Reserved even byte alignment 3Ah long reserved 3Eh long reserved 42h byte powerSaveMode Operating mode 00h no power save 01h basic power saving 02h advanced power saving preliminary 43h byte reserved 44h byte latestErrorCode Latest error code 45h byte detectedConnections Detected connections 00h no connections 02h USB connection detected Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 13 EXAMPLE USE CASES SwesO02452013 07 17 11 20 00 gt w 803101 01 Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 14 ANALOG INPUTS REGISTER SET Software Device 81h Version 01h This register set is used to read the microcontroller s analog input channels The index numbers refer to the ADC pin numbers shown in Atmega32u4 specification Note that channels 2 and 3 do not really exist and most other channels are configured for other pu
7. possible to deal with different versions If register set version byte has its most significant byte set i e the value is equal to or greater than 80h it means that the register set has additional four control bytes in the beginning These bytes are used to control software devices that are continuously run by the CPU REGISTER TYPES There are the following possible register types byte word long string Null terminating character array byteg Hidden byte array reading ff bytes returns all available data One or more of the following operations are possible R Read W Write Rs Readable also as a formatted string using Nb 00 Ws Writable also as a formatted string using instead of colon R Arbitrary number of bytes available can be read using Nb ff or maximum amount that is needed Reading and writing of several registers with a single command is possible only for the basic register types byte word and long Even in these cases it might be that all data is not updated so the safest way is always to access a single register at a time Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 11 MASTER REGISTER SET Software Device 80h Version 81h Master Register Set is used to control basic features of the iProtoXi Aistin firmware Most important things are board s ID protocol options and access to on board real time clock Detailed descriptions are listed in the table below
8. takes a form gt A DaRaNb ER or gt A DaRaraNb ER Where ER is a non zero hexadecimal error code Note that Nb will be the value that was used in the message that caused this negative acknowledge It does not tell the number of data bytes in this message which is always one the error code Version V or an empty message A V message or an empty message can be used to see some system information i e by giving only wow gt character and hitting enter on terminal gt Version information is then shown and will be something like the following gt D 80140C ipxdevice 01 Node ID gt D 800805S0 8 0 Software version EDS OO COS sre ra Hardware version gt D 800E0C 27EB142B0000 Board UID SDESO2Z4 1 SS2013 04 05 15 27 48 Real time clock gt D 803806 5D80818D9092 Scan result available devices Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 9 COMMENT CHARACTER Linefeed or carriage return character ascii 10 or 13 is always used to detect end of message line Because messages may be taken from a script file system also accepts human readable comment string after the actual message Comment is separated from the message with a single quote ending quote is not needed For example gt R 802400 read real time clock as a text There is a special exception related to this a comment character can be used to start a message that contains only a comment as foll
9. and Ra are device and register addresses whereas Nb is the number of bytes that we want to read If Nb is not given or is zero it indicates that we want to get the Ra in readable format Thus the result will be returned as a text instead of hexadecimal byte values In case of e g 16 bit register the string may be a decimal integer whereas in case of date time it is a string containing year month day and time The actual number of bytes that will be read from the register Ra is register dependent and may or may not be shown in the responded data message within the field as Nb value Read message can be put to repeat itself by giving a time field with a value that sets the period between reads For example the following code reads a register 24h from a device 80h once a second Reading stops whenever a new message is send or started gt R 8024 1000000 Charactes m and s can be used to indicate milliseconds and seconds correspondingly This avoids using long microsecond numbers The previous command can thus be replaced with either of the following forms gt R 8024 1000m gt RG8024 1s Data D Data message appears normally as a response to a read message as follows gt D DaRaNb DOD1D2 or gt D DaRaraNb DODID2 or gt D DaRaNbS string or gt D DaRaraNb string The target ID field may or may not be included depending on the related configuration option In the first case Nb corresponds to the number
10. command gt w 8d05 02 stop VM If you want to auto start the program after uploading just add the start command as a last line into the file before uploading However whether your program starts again automatically after power down depends on a setting on device 8Dh Master register set To set auto start command gt w 8d05 13 set auto start ON To turn it off command gt w 8d05 12 set auto start OFF HELLOWORLD iProtoXi Aistin virtual machine program for VM VOA gt w 8d05 10 command re program VM gt w 8e00 90040001 VM V04 program ID gt w 8e04 91001000 provided device address version reg set size actual code gt we8e08 1d loop begins gt w 8e08 2ce803 sync at 1000 ms 3e8h ms gt w 8e08 0b040c42 send Hello world D message 12 chars gt w 8e08 0dff jump to beginning loop program s register set data gt w 9104SHello world gt w 8d05 04 command start the program TRAFFICLIGHTS iProtoXi Aistin virtual machine program for VM VO4 This example needs you to have the iProtoXi LED controller board installed W C LeEOEOxa Oori gina ly seneated 20 ISS 04 ORINE gt w 8d05 10 command re program VM gt w 8e00 90040001 VM 04 program ID gt w 8e04 91000600 provided device address version reg set size Code begins gt w 8e08 1e34 select LEDs device gt w 8e08 030040 Mlle Che Ge 5 6 gt w 8e08 03365b U PWM gt w 8e08 1d loop begins gt w 8e08 6c04
11. d For setting send a string as YYYY MM DD HH MM SS 28h 2 bytes reserved Reserved for different type of real time clock 2Ah long RW usCounter Free running microseconds counter 2Eh byte RW messageBeginChar gt message begin character not implemented 2Fh byte RW positiveAck Protocol control 00h do not send positive acknowledgment 01h always send acknowledgment 30h byte RW messageFields Protocol control 00h do not include optional fields 01h include location field 02h include senderlD field Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 12 03h include both 31h byte RW includeTimestamp Protocol control 00h do not include timestamp 01h include timestamp before data 81h include timestamp after data 32h byte RW dataEncoding Protocol control 00h encode data as hex no spaces other values are not currently supported 33h byte RW commChannels Which channels are used for messaging 00h no messaging 02h serial channel 0 USB 04h serial channel 1 e g Bluetooth 06h serial channels 0 and 1 34h byte RW outputChannels Where to output data messages see commChannels for accepted values 35h byte RW forwardChannels Where to forward messages see commChannels for accepted values This can be used to monitor message traffic from another channel 36h
12. d bytes rd rd rs add sw E7 rd rs Add signed words rd rd rs sub b 08 rd b Substract an immediate unsigned byte value sub w 28 rd wH Substract an immediate unsigned word value sub b 48 rd rs Substract unsigned bytes rd rd rs sub w 68 rd rs Substract unsigned words rd rd rs sub sb 88 rd b Substract an immediate signed byte value sub sw A8 rd wH Substract an immediate signed word value sub sb C8 rd rs Substract signed bytes rd rd rs sub sw E8 rd rs Substract signed words rd rd rs send n 4B rs Nb de Send Nb bytes from rs to output channels as a D message sync OC wi Synchronize to microseconds time interval sync 2C wi Synchronize to milliseconds time interval sync 4C rs Synchronize to microseconds time interval sync 6C rs Synchronize to milliseconds time interval jmp b OD jb Signed one byte relative jump jmp w 2D jw Absolute two byte jump cmp b OE rs b Compare unsigned bytes cmp w 2E rs wH Compare unsigned words cmp sb 8E rs b Compare signed bytes cmp sw AE rs wH Compare signed words Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 23 jmpneq OF jb Jump if not equal jmpeq 2F jb Jump if equal jmpg 4F jb Jump if greater jmpgeq 6F jb Jump if greater or equal jmpl 8F jb Jump if less jmpleq AF jb Jump if less or equal abs b 15 rd Take an absolute value from a signed byte abs w 35 rd Take
13. d device address namely hex 80 but there can be several other devices within the same node each having their unique address Furher each device has one or more registers which are accessed using unique register address In case of real IC devices connected to the main board they can be accessed transparently as specified in their data sheets This is a very useful feature In outcoming messages receiverlD field is a copy of latest incoming message s senderlD field This makes possible to track where an outcoming received message should be forwarded in case of multi client configuration However these fields are both optional and may or may not exist Existence of senderID in outcoming messages can be configured via Master Register Set MESSAGE STRUCTURE All messages have the following logical structure the corresponding characters as described in the previous chapter are shown All fields may or may not be present Also the time field may be configured to appear before the data begin code message code sender receiver location data time end code gt X LF CR Where X is one of the following message codes R Read 7 Write D Data S Scan A Acknowledge Some examples of valid messages could be gt W 343603 5B23AF gt A 343603 gt R 1D2901 gt D 1D2901 8D PROTOCOL CONFIGURATION OPTIONS Protocol has three configuration bytes that are available through system r
14. e address 08h for each instruction line the system automatically keeps track where the next program instruction must be located In most cases that eliminates the need to calculate addresses by hand EXAMPLE USE CASES gt w 8d05 10 Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 19 gt w 8d05 10 re program VM gt w 8e00 90040001 VM type ID V04 with 0x0100 bytes of room gt w 8e04 ab010000 program UID dev addr version reg set size gt w 8e08 00 actual program code 00 no program Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 20 VIRTUAL MACHINE RAM REGISTER SET Software Device 8Fh unprogrammed 91h anonymous application 92h 9Fh iProtoXi application AOh EFh user application Version 00h FFh set by application VM RAM register set is used to store your own application s data as you wish However first four bytes should always be laid out as described below They will be directly copied from the program register set from the bytes 4 7 The rest of RAM area can be used as needed It is also possible to store static data such as constants and strings into this area and they will resist over power down since data is stored to EEPROM and re loaded on boot up Addr Type R W Name Values purpose ess 00h byte R deviceAddress 8Fh 91h 9Fh AOh EFh identifies your device that the VM application is implementing The values below AOh and over EFh are res
15. egisters see Master Register Set Configuration options affect also to virtual machine output Shortly they are as follows Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 6 positiveAck option controls whether or not acknowledge message is sent as a reply to all received messages except the acknowledge message itself indeed If it is set ON value is one then positive acknowledge is sent always The default value is OFF zero Note negative acknowledge i e error is sent always independent of this option messageFields option is for performance reasons to control if outcoming messages will have optional targetID field and or senderlD field dataTimestamp option is also for performance reasons to control whether or not outcoming data messages will have timestamp field or not Default value zero is OFF whereas 01h corresponds to ON and the field is positioned before the data Value 81h is ON and the field is positioned after the data The timestamp precision is fixed to 10 digits in microseconds MESSAGE TYPES Write W Write message takes one of the following forms when writing binary data in hexadecimal format gt W DaRa DODID2 8 bit register address gt W DaRaNb DODID2 8 bit register address Nb given gt W DaRaraNb DOD1D2 16 bit register address Nb is always needed Where Da is the device address Ra is the register address Nb is the number of bytes and DO D1
16. erved for other purposes At the beginning of programming address is set to 8Fh When program is started default value 91h is used if the program does not specify any other value anonymous application 01h byte R regsVersion 00h FFh identifies your register set version 02h word R regsSize 00h 80h total size of your register set meaning the bytes you are providing as an interface to be read and written by the Aistin protocol 04h byte RW ram RAM and static data area for free use by your VM 7Fh application Note that bytes 00h 03h are read only To change them you must provide the values via the Program register set using register programUID bytes 4 7 EXAMPLE USE CASES gt w 8d05 10 begin programming gt w 8f04SMy string The correct and only way to change ram area s device address is to begin programming and then to write the desired device address into program area s register 04h This is shown below gt w 8d05 10 begin programming gt w 8e04 ab set device address we want to provide to ABh Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 21 VIRTUAL MACHINE PROGRAM INSTRUCTION SET For the Device 8Eh version 04h Virtual machine is based on assembly alike instructions laid out as byte stream with operation codes and corresponding arguments The operation code byte opcode is divided into following bits bit
17. evice using 8 bit register address readdev8 w 21 rd Ra Read a word 2 bytes from current device using 8 bit register address readdev8 n 02 rd Ra Nb Read Nb bytes from current device using 8 bit register address writedev8 b 03 Ra b Write an immediate byte to current device using 8 bit register address writedev8 w 23 Ra w Write an immediate word to current device using 8 bit register address writedev8 b 43 Ra rs Write a single byte to current device using 8 bit register address Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 22 writedev8 w 63 Ra rs Write a word to current device using 8 bit register address writedev8 n 04 Ra rs Nb Write Nb bytes to current device using 8 bit register address copy b 05 rd b Copy an immediate byte to rd copy w 25 rd w Copy an immediate word to rd copy b 45 rd rs Copy a byte from rs to rd copy w 65 rd rs Copy a word from rs to rd copy n 06 rd rs Nb Copy Nb bytes from rs to rd add b 07 rd b Add an immediate unsigned byte value add w 27 rd wH Add an immediate unsigned word value add b 47 rd rs Add unsigned bytes rd rd rs add w 67 rd rs Add unsigned words rd rd rs add sb 87 rd b Add an immediate signed byte value add sw A7 rd wH Add an immediate signed word value add sb C7 rd rs Add signe
18. iProtoXi roto e 3 Q User Gu d i Xion TABLE OF CONTENTS 1 INTRODUCTION 2 AISTIN PROTOCOL DATA FIELDS AND CHARACTER ALLOCATION MESSAGE STRUCTURE PROTOCOL CONFIGURATION OPTIONS MESSAGE TYPES COMMENT CHARACTER 3 SOFTWARE DEVICES REGISTER TYPES MASTER REGISTER SET EXAMPLE USE CASES READING REAL TIME CLOCK SETTING REAL TIME CLOCK INCLUDE TIME STAMP TO DATA MESSAGES ANALOG INPUTS REGISTER SET EXAMPLE USE CASES READING BATTERY VOLTAGE CHANNEL ONCE PER SECOND READING ANALOG INPUT CHANNELS 0 AND 1 TEN TIMES PER SECOND VIRTUAL MACHINE REGISTER SET EXAMPLE USE CASES START TO RUN USER S VM PROGRAM STOP RUNNING THE PROGRAM START UPLOADING A NEW PROGRAM FOR THE VM VIRTUAL MACHINE PROGRAM REGISTER SET EXAMPLE USE CASES START UPLOADING A NEW PROGRAM UPLOAD AN EMPTY PROGRAM THAT HAS DEVICE ADDRESS ABH Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi NO O ul 10 11 11 12 14 14 14 14 15 16 16 16 17 18 18 18 18 19 19 19 20 VIRTUAL MACHINE RAM REGISTER SET EXAMPLE USE CASES WRITE A STRING INTO RAM AREA CHANGE RAM AREA S DEVICE ADDRESS VIRTUAL MACHINE PROGRAM INSTRUCTION SET SOME EXAMPLE PROGRAMS HELLOWORLD AIS TRAFFICLIGHTS AIS Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 21 21 21 21 22 25 25 25 1 INTRODUCTION iProtoXi Aistin firmware is the software provided with
19. of bytes whereas in the latter case it will be either zero or the length of the string Further if timestamp was requested then there will be more information as follows gt D DaRaNb timestamp DODI1D2 or gt D DaRaraNb timestamp DODID2 or gt D DaRaNb timestampSstring or gt D DaRaraNb timestamp string Now the additional character indicates that the following number is a timestamp for the data when it was read The value is always in microseconds Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 8 Scan S This message is an alias to reading scan register from the device 80h So the following two messages do the same thing gt RG8038fFf or SS The 38h is the address of scan register see register tables at the end of this document Note that ff is used to indicate we want to read as many bytes as there is available After a scan command a sequence of hexadecimal numbers corresponding to the available device addresses is returned as a data message e g as follows gt D 803808 1D203480818D9091 Acknowledge A If configuration option positiveAcknowledges is ON then the positive acknowledge message takes a form gt A DaRaNb or gt A DaRaraNb Where DaRaNb has the same contents that was used in the message that caused the acknowledgment This field may or may not be present depending on the includeAddress configuration option Negative acknowledge is sent always and
20. ol byte EXAMPLE USE CASES gt w 8d05 04 gt w 8d05 02 gt w 8d05 10 Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 18 VIRTUAL MACHINE PROGRAM REGISTER SET Software Device 8Eh unprogrammed 90h programmed Version 04h Program register set is used to store virtual machine s application program All programs must have specific eight bytes at the beginning as documented below Programming is controlled using virtual machine register set see Device 8Dh Add Type R W Name Values purpose ress 00h byte R deviceAddress 8Eh when programming or 90h when already programmed Identifies this device Virtual Machine Program O1h byte R regsVersion 04h identifies this register set version This is also used to check program s compatibility with VM 02h word R regsSize 0100h total size of this register set This is maximum size of VM application including this header 04h byte RW programUID 0 AOh EFh device number that the VM application is implementing will be copied to VM RAM 05h byte RW programUID 1 Register set version that the VM application is implementing will be copied to VM RAM 06h word RW programUID 2 3 Register set size that the VM application is implementing will be copied to VM RAM 08h byte RW program The actual VM application s program code FFh To send a program you can us
21. ows This is a comment only That kind of message is just ignored by the Aistin system The lines that do not begin with gt or single quote will be handled as off message data and forwarded to a possible connected raw device such as a Bluetooth module Note Because copy pasting of single quote from different kind of documents sometimes produces varying ascii code the system interprets all character codes equal to or higher than 80h similar way as the single quote character Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 10 3 SOFTWARE DEVICES In addition to the real I2C devices the system has a few software devices used to access software features Those devices have their own register sets described in the following sections Register set is a set of parameters that can be read or written by the protocol There are different types of parameters such as bytes words and strings It must be noted that words two bytes and longs four bytes are in big endian format i e low order byte becomes always first Each device has its unique device address that is used to address the corresponding register set In addition each register set has a version number to distinguish between possible different versions of register sets The version number and total size of the related register set can be read from the first four bytes of each register set These four bytes have always fixed version independent order making
22. register address Ra DaRaNb Target identifier device address Da 8 bit register address Ra number of bytes Nb DaRaraNb Target identifier device address Da 16 bit register address Rara number of bytes DOD1D2 Data bytes in hexadecimal format no spaces between bytes string Human readable data a text string or e g a signed 16 bit integer time Time value in decimal most often in microseconds senderID Identifier string nodelD of the sender of a message maximum length is 12 characters receiverID dentifier string nodelD of the receiver of a message maximum length is 12 characters Comment In case of 16 bit register address the byte order is lo hi low order byte comes before the high order byte so called big endian Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 5 The protocol aims to be stateless two way and symmetric This means that both sides can send a message at any time and they must be prepared to receive a message at any time Because of symmetricy both sides can behave as a client and as a server all message types are available for both sides There are a few configurable protocol parameters described later The overall system is based on idea of writing and reading data to and from a connected iProtoXi system There is also a concept of device address that is used to route messages into the correct place within the system The iProtoXi Master Device has a fixe
23. rposes in default iProtoXi Micro configuration Only channels 0 and 1 are free for user purposes Channel 5 corresponds to USB voltage level channel 6 to battery voltage level and channel 7 measures current consumed by add on sensor boards Add Type R W Name Values purpose ress 00h byte R deviceAddress 81h identifies this device Analog Inputs 01h byte R regsVersion 01h identifies this register set version 02h word R regsSize 0022h total size of this register set 04h byte R numAdcChannels 14 number of analog input channels in this register set Note All channels are not supported by the hardware 05h byte reserved Reserved for future use even byte alignment 06h word R analogInputs 0 Analog input value for channel 0 08h word R analogInputs 1 Analog input value for channel 1 OAh word R analogInputs 2 Analog input value for channel 2 OCh word R analogInputs 3 Analog input value for channel 3 OEh word R analogInputs 4 Analog input value for channel 4 10h word R analogInputs 5 Analog input value for channel 5 12h word R analogInputs 6 Analog input value for channel 6 14h word R analogInputs 7 Analog input value for channel 7 16h word R analogInputs 8 Analog input value for channel 8 18h word R analogInputs 9 Analog input value for channel 9 1Ah word R analogInputs 10 Analog input value for channel 10
24. sync at r04 ms VS Cie ae Celeste lie gt w 8e08 031c00 LEDO R gt w 8e08 031600 LEDO G gt w 8e08 031700 LEDO B gt w 8e08 031d00 LEDI R Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 25 gt w 8e08 gt w 8e08 gt w 8e08 gt w 8e08 gt w 8e08 gt w 8e08 gt w 8e08 gt w 8e08 gt w 8e08 Change gt w 8e08 gt w 8e08 gt w 8e08 gt w 8e08 gt w 8e08 Change gt w 8e08 gt w 8e08 gt w 8e08 gt w 8e08 gt w 8d05 031800 031900 031e10 031a00 031b00 6c04 Add yellow light 031d10 031810 6c04 to green 031610 031d00 031800 031e00 6c04 to yellow 031600 031410 031810 Odff program s register set data gt w 9104 0004 04 Aistin Firmware 0 8 0 User Guide EDITE EDIB ED2 R ED2 G ED2 B sync at r04 ms JTE DIER LED1 G sync at r04 ms EDO G EDIR ED1 G ED2 R sync at r04 ms ED0 G ED1 R ED1 G loop to beginning default speed 0400h ms 1024 ms command start the program 2013 iProtoXi www iprotoxi fi 26
25. the iProtoXi Micro controller board It is designed to support easy use of add on boards such as accelerometer sensor and gyro as well as temperature and humidity sensors or the RGB LED board To achieve this firmware has ability to communicate with outer world using a specifically designed human readable protocol called Aistin Protocol In more complicated configurations there may be several boards connected to a server Aistin Server which in turn may be connected to some clients such as specific Web pages Furthermore there might be several servers connected together to enable variety of networking configurations This makes possible to network sensors even over the internet Below is an example picture of a possible complex networked system configuration Sensors Sensors Actuator ae I2C bus I2C bus Aistin I2C bus 2 oe en Aistin Controller Controller 3 1 USB links Personalo Aistin Server 2 Aistin Server 1 ae Bluetooth links Aistin Controller 4 Sensors Actuators I2C bus Client 1 Plain Terminal Client 2 Web Page Aistin Controller 5 Aistin protocol makes it possible to access all the networked sensors and actuators from the clients with a single unified way In current implementation I C types of devices are supported but other common buses may be implemented later on Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iproto
26. ug messages 01h show debug messages 07h byte R vmControl VM program autostart bits 01h auto start after reset 00h do not auto start 08h word programMemSize Size of available program memory for a VM program OAh word ramSize Size of available RAM memory for a VM program OCh byte RW outputChannels Channels where VM sends messages see Master Register Set for more information ODh byte RW outputOptions 00h output plain data 01h output real time clock on VM start and stop OEh byte R condition VM condition code register OFh byte reserved Reserved for future use even byte alignment 10h word R pc Program Counter address of the instruction in progress 12h word R firstTag Address of first TAG in the program 14h word R prevTag Address of previous TAG in the program 16h long R vmStartDatetime Real time when VM started to run program 1Ah long R vmStartTime Microseconds time when VM started to run program 1Eh long internal Internal use 22h long reserved Reserved for future 26h byte internal Internal use Aistin Firmware 0 8 0 User Guide 2013 iProtoXi www iprotoxi fi 17 27h byte reserved Reserved for future 28h byte internal Internal use 29h byte reserved Reserved for future 2Ah byte RW ownerNodelD 13 Node s ID that currently controls VM null 37h terminating string This is set automatically when writing to deviceContr
27. xi fi 4 2 AISTIN PROTOCOL The Aistin protocol is designed to work using any 7 or 8 bit ascii bearer and is based on ASCII characters only One of its main principles is to be both human and machine readable so it can be used with just a simple terminal program such as Windows Hyper Terminal However the protocol has a clear fixed format to enable other software applications on top of it Another important aspect is asmall memory footprint thus instead of having large set of different command words there are only few one letter commands The needed command divergence is achieved by using numerical codes called addresses This thinking is derived from the world of hardware 2C bus and people familiar with such kind of things will feel the system very pleasing Third thing provided by the protocol is node addressing It is possible to address an individual iProtoXi controller board in a network even though the board itself doesn t implement a TCP IP stack DATA FIELDS AND CHARACTER ALLOCATION The protocol is based on data fields that are preceded by a single special character The characters are allocated as follows gt X Beginning of a message and a message code X when it is the first character in a line after a carriage return and or a linefeed LF Line feed ascii code 10 end of a message CR Carriage return ascii code 13 alternative end of a message DaRa Target identifier targetID device address Da 8 bit
Download Pdf Manuals
Related Search
Related Contents
Cisco Systems SOHO 71 Installation Manual Advanced Test Equipment Rentals Télécharger la notice Protector PVC Perchloric Acid & Acid Digestion Télécharger le communiqué de presse 車速感応式 ドアロックシステム EXTRAORAL CAMERA USER`S MANUAL Copyright © All rights reserved.
Failed to retrieve file