Go Back   VEX Forum > Community > Technical Discussion

Technical Discussion Open Technical Discussion of the VEX Robotics System.

Reply
 
Thread Tools
  #21  
Old 07-26-2011, 04:12 PM
mvcisback mvcisback is offline
Junior Member
 
Join Date: Jul 2011
Posts: 13
Re: SDCC for Vex is here!

Quote:
No, I'm not using a source hosting service at this time. You can send patches via email for now. ( jwbacon --- tds dot net )
As for patching, I did modify the install process to assume less about the base linux system (i.e. using the which command to find binaries) and was considering make and aur (arch user repo) install package for arch linux.

Quote:
If you're interested in helping with the Cortex port, I'm happy to delegate big or small tasks. There are ports (FreeBSD and OS X) for the gcc toolchain and stm32loader in the ports section of my website.
Ok, well at the moment my current development platform is arch linux so I'll see if I can get the stm32loader up and running. Also while I do have C/arduino experience I'm not as familiar the PIC and Cortex controllers. If you could provide some tips or point me in the right direction to help port I'd love to help.

Quote:
As for competition start signals, you might take a look at the Vex default code for MPLAB. This applies only to PIC controllers with RF control. Not sure about Vexnet.
I'll dig through the Vex default code to see if I can find the competition signals for the original PIC controllers. I suspect it may be the same or similar for vexnet because PIC controllers with Vexnet were at one point (idk anymore) run alongside with Cortex controllers.

Last edited by mvcisback; 07-26-2011 at 04:23 PM.
Reply With Quote
  #22  
Old 07-26-2011, 09:03 PM
jpearman's Avatar
jpearman jpearman is online now
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,018
Images: 2
Re: SDCC for Vex is here!

Quote:
Originally Posted by outpaddling View Post
As for competition start signals, you might take a look at the Vex default code for MPLAB. This applies only to PIC controllers with RF control. Not sure about Vexnet.
Not sure what you are after exactly but I can tell you what I know of how the PC software achieves this using the VEX programming cable. This would be for a serial connection from PC to Joystick. I have not looked at USB connection direct to Cortex much yet, it uses similar messages to the serial communication for many things but in this area I assume it would be different.

To toggle Robot Enable/Disable or Autonomous/Driver control, the following sequence is used.

1. Change serial baud rate to 9600.
2. Set RTS
3. Wait 5mS
4. Clear RTS
5. Wait 15mS
6. Set RTS
7. Wait 10mS
8. Send serial char 0x35 to toggle enable/disable or
Send 0x22 to toggle Autonomous/Driver control
9. Wait 20mS
10. Clear RTS
11. Wait perhaps 250mS, you can get some feedback on CTS I think but its just easier to have a delay.
12. change baud back to normal and continue communications.

This communication does not go through the programming cable to the Joystick but is intercepted by a PIC inside the programming adapter.

The PIC decodes the 0x35 (or 0x22) character and creates a pulse train on the RTS line going to the Joystick. 8 pulses, each of 3.3mS with a 50% duty cycle (that is 1.65mS low, 1.65mS high) are sent for the Enable/Disable command. 6 pulses with the same specs are sent for the Autonomous/Driver command. Pushing the button on the programming adapter sends 5 pulses.

Here's a waveform showing RTS in (lower trace) to RTS out (upper trace) on the programming cable for the autonomous command.



I've no idea why it has to be this complex but can only assume it's for some type of backwards compatibility with the older PIC 0.5.

Hope this was not confidential but engineers are curious people, we always want to know how things work
Attached Images
File Type: jpg TEK00000.jpg (12.4 KB, 528 views)
Reply With Quote
  #23  
Old 07-27-2011, 06:24 PM
mvcisback mvcisback is offline
Junior Member
 
Join Date: Jul 2011
Posts: 13
Re: SDCC for Vex is here!

Thanks for the response. I'm confused as to whether this is specific to either vexnet or the crystals however this is something that I will try to investigate.

Also is there any prepossessing on the microcontollers behalf? I ask because the vexnet adapter for the old PIC controllers goes through a serial port ultimately and I suspect might be simpler when processed that way (though idk and the same function wouldn't work for both controllers then....)
Reply With Quote
  #24  
Old 07-27-2011, 10:29 PM
jpearman's Avatar
jpearman jpearman is online now
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,018
Images: 2
Re: SDCC for Vex is here!

Quote:
Originally Posted by mvcisback View Post
Thanks for the response. I'm confused as to whether this is specific to either vexnet or the crystals however this is something that I will try to investigate.
It's specific to the serial programming cable which can, I believe, be used with both the cortex and Pic. In the case of the Cortex, the serial commands are converted by the joystick controller to either USB commands or commands over vexnet and sent to the cortex cpu. I had done some investigation of the USB interface, not to difficult to use but ii made more sense to me to use the serial cable as the joystick was going to be needed anyway.
Reply With Quote
  #25  
Old 07-27-2011, 11:32 PM
mvcisback mvcisback is offline
Junior Member
 
Join Date: Jul 2011
Posts: 13
Re: SDCC for Vex is here!

Ah I see.

I more or less understand the direct programming cable implementation; however, my main concern is programming cable -> old big controller's outputs the same as programming cable -> joystick (vexnet).

For example:
Configuration 1:
over the old rf controllers it'd go, PC -> Programming Cable -> Old remote -> PIC tx port -> Processed

Configuration 2:
over vexnet using adapter to PIC, PC -> Programming Cable -> Old remote(vexnet) -> vexnet adapter -> serial -> Processing

Configuration 3:
Cortex Controller, PC -> Programming Cable -> joystick -> cortex vexnet adapter -> Processing

I'm mainly interested in the last two steps of each configuration
Reply With Quote
  #26  
Old 07-28-2011, 11:25 AM
Thorondor's Avatar
Thorondor Thorondor is offline
Senior Member
VEX # 3057
 
Join Date: Jul 2011
Location: New Jersey
Posts: 321
Re: SDCC for Vex is here!

hold on a sec. Can I download code to cortex from my mac? If so how do I do it cause i read the first post and it seemed kind of confusing and I read more posts and it just confused me more. Does this thing like compile and everything?
__________________
Tenacious Tech 2011-2012 Programmer
Technology Division 3rd Seed (9-1-0) Technology Division Amaze Award Programming Skills World Finalists (28 points)
Reply With Quote
  #27  
Old 07-28-2011, 12:40 PM
mvcisback mvcisback is offline
Junior Member
 
Join Date: Jul 2011
Posts: 13
Re: SDCC for Vex is here!

The port of open vex to cortex doesn't seem complete but there is a description of the tool chain using easy c produced hex files at http://personalpages.tds.net/~jwbacon/vex.html
Reply With Quote
  #28  
Old 07-28-2011, 03:40 PM
jpearman's Avatar
jpearman jpearman is online now
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,018
Images: 2
Re: SDCC for Vex is here!

Quote:
Originally Posted by Thorondor View Post
hold on a sec. Can I download code to cortex from my mac? If so how do I do it cause i read the first post and it seemed kind of confusing and I read more posts and it just confused me more. Does this thing like compile and everything?
Theoretically you can download although I have not tried it, you still have to compile in EasyC. Even if we had a compiler for the Mac I don't think anyone has enough information to create a runtime library to link against. Although this type of project is interesting, at the end of the day your best bet is to use the existing tools under windows, or in a virtual PC environment like Parallels.
Reply With Quote
  #29  
Old 07-28-2011, 07:00 PM
mvcisback mvcisback is offline
Junior Member
 
Join Date: Jul 2011
Posts: 13
Re: SDCC for Vex is here!

Yeah, specifically if you can find a way to generate the hex files you can use stm32flash....
Reply With Quote
  #30  
Old 07-28-2011, 10:54 PM
jpearman's Avatar
jpearman jpearman is online now
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,018
Images: 2
Re: SDCC for Vex is here!

So out of curiosity I did have a look at the STM32 loader which is part of this package. No problems compiling under OSX 10.5.8 (yes, the Mac I use most is still on Leopard although I have others on 10.6 and 10.7) but it did not connect with the Cortex. After a couple of hours debugging found that there was a problem with the very first serial write so I added a retry for the initial baudrate auto-negotiate command. You have to press the button on the programming cable to put the cortex into bootloader mode also. So I can see device info and download the flash. No plans to upload an image as there's no real upside and bricking the cortex is not an option I'm willing to chance.

The protocol for flash read/write is pretty simple and is documented well. If I were going to need this functionality I would probably rewrite with a GUI but I'm not sure there's really any point.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 11:44 PM.


VEX and VEX Robotics are trademarks or service marks of Innovation First International, Inc.
Copyright © 2002-2013. All Rights Reserved. VEX Robotics, Inc. is a subsidiary of Innovation First International, Inc.
All other product names/marks of others are the property of their respective owners.