View source
From HobbyVex
for
VEX On-Line Code
Jump to:
navigation
,
search
This page is a mirror of [http://www.vexforum.com/local_links.php?catid=26&sort=N&pp=10&page=3 MarkO's VEX on-line code page] for serial communication with the VEX controller. ==Vex On-Line Controller Code v2.x (Available Source Version 0.81 Beta)== ***** Updated to release v0.81β ***** Tested with: IFI/intelitek Loader 2.8.0.1 (Ships with EasyC 2.8.0.1) Tested against: VexOnlineCode.hex (25,704 bytes -- 1-13-06 12:00:14 Date-Time) I have tested various behaviors of the IFI/intelitek Loader 2.8.0.1 On-Line Window with the "default" VexOnlineCode.hex noting behavior and the Data exchanged between the two computers. This Vex On-Line Controller Code (0.81 Beta) mimics that behavior If you note any issues, check your IFI/intelitek Loader version and report it to me so I can try to replicate it. (All Decimal Number will appear as normal, Hexadecimal numbers will be Prefixed with "0x".) To Setup: Download MPLAB and MCC18 v2.40 Compiler (AKA The ToolChain) MPLAB v7.50. mcc18 v2.40 SE. Install MPLAB and MCC18 v2.40. To Compile: Download the Vex Starter Code. Unzip the "Vex Starter Code", Keep your Directory Close to the ROOT as possible (62 Character Limit for longest File Name plus Path). Unzip the "Vex On-Line Controller Code" into same directory (folder) as "Vex Starter Code". This Zip File for Vex On-Line Controller Code (0.81 Beta) only contains the Source Files different than the Vex Starter Code. It Will Not compile by itself. Start MPLAB. Select "Project->Open" from the Menu. Navigate to the "Vex Starter Code" Directory. Click on the Project "VexUserCode_OL2" (Vex User Code, On-Line v2). Select "Project->Build All" from the Menu. If asked about which Assembler to use, select the one in the "mcc18\mpasm" directory, not the MPLAB one. If you select WRONG, and the Compile fails to Build and Link, you can correct the project under "Project->Set Language Tool Locations..->Microchip C18 Toolsuite->Executables". If asked about which Linker to use, select the one in the "mcc18\bin" directory, not the MPLAB one. If you select WRONG, and the Compile fails to Build and Link, you can correct the project under "Project->Set Language Tool Locations..->Microchip C18 Toolsuite->Executables". If you get NO Errors or Warnings, you have all you need to start making changes. Ask here if you get Errors and/or Warnings, don't forget to Cut and Paste, so we know EXACTLY what the Errors and/or Warnings are. Data Format: (borrowed from bg_blea's post, I'm Lazy, why retype.) From Vex On-Line Controller Code: Default configuration of 4 Analogs, 6 digital in and 6 digital out. The controller will keep on writing strings like 'BOARDDATA a1...a4 d1 ... d6 i1... i6' Where a1 through a4 are values of analog ports followed by 6 digital inputs and finally the interrupts. From IFI/intelitek Loader 2.8.0.1: (Note: ALL numbers are Hexadecimal, but DON'T have the "0x" prefix when sent) Sent on Open of On-Line Window "0x0F 0x0F 0x08 0x40 0xB8 0x04" InitializeOnLineMode "0xC9 0x17 0x01 0x00 0x00 0x00" SetMotor( 00-07, 00-7F-FF) "0xC9 0x17 0x04 0x00 0xFF 0x00" SetDigitalOutput( 00-05, 00-01 ) "0xC9 0x17 0x06 0x00 0x01 0x00" Reset "0xC9 17 03 00 00 00" Close "0xC9 0x17 0x02 0x00 0x00 0x00" Notes: I don't know what the Initialization Codes "0x0F 0x0F 0x08 0x40 0xB8 0x04" do. They are ignored. Ver 3.x of the IFI/intelitek Loader do not appear to send them. The Broadcast Status messages from the Vex Controller are Low-Tech, I am merely outputting Text of the Information. ***** v0.81b ***** ANALOG/DIGITAL I/O is now selectable with a Single Function Call, "DefineControllerIO()". Function "OnLine_Broadcast()" automatically prints out the correct number of ANALOG and DIGITAL INPUTS. Supports OUTPUT Control of I/O Ports 01-10, if you are not using them for INPUT. ***** ***** ***** What did I forget???? MarkO [Suggest other entries I might like] Submitted by MarkO Find all entries from this user 09-09-2008 33.62 Kbytes Hits 166
Return to
VEX On-Line Code
.
Views
Page
Discussion
View source
History
Personal tools
Log in
Navigation
Main Page
Community portal
Current events
Recent changes
Random page
Help
Search
Toolbox
What links here
Related changes
Special pages