Cortex/senors/proggraming help URGENT!


Since our last post we have been working hard on a brand new robot, we have now built it and are supposed to be begin the programming, with only a few days left of programming before we fly out on Monday. However, we have been suffering some severe problems with getting reading from our digital sensors.

THe issue is that we get no readings from anything in the digital ports. After much thinking and attempts at different types of wiring, we put this down to the burning smell coming from our cortex. We tried a different cortex and the problem was solved. However, after around half an hour of re-wiring our cortex gave off a strong burning smell and the sensors again stopped returning values!

We are complete stumped about what to do, and any help would be really appreciated.

Some general info that may be helpful:

We have three encoders in digital ports 1/2 5/6 11/12 and pneumatics in port 9 (although all the ports have been rotated many times!)

We also have four bumper switches in analogue ports 1-4 and 2 IME’s, the IME’s had worked when using the first cortex but no longer!

I can also post pictures of my code or robot if needed ( I haven’t included them as I’m not sure if they are!)

Thanks again


Virus robotics

Sounds like a wiring short killed the cortex.

What is still working? Can you download code?

Can you post a picture of how everything is connected? Remove all wiring and add just one sensor, see if that works. A “strong burning smell” is generally an indication of something bad.

Hey, a big thanks for the quick response!
Yes we can download code, and the bumper switches work. Do u think its woth swapping in our last remaining cortex?
Its night time in the UK at moment but i will get those pics for you tommorow. We have tried one sensor but drew a blank.
Thanks again


No, don’t swap in the last cortex until you figure out what’s wrong.

Let’s figure out what is working, with just one bumper switch lets check all the ports. First, are you sure that the sensors are all plugged in the correct way around, the white signal wire will be towards the center of the cortex (near the VEXnet key), the black wire should be on the outside. Should look like this

Are you using EasyC or ROBOTC? The tests will be different depending on which program but the general idea will be to test all the digital ports and analog ports one at a time to make sure they are all good.

You didn’t mention potentiometers, do you have any connected?

Were/are the motors working?

We use robotc, but I am he only person in the team who know how to use it and I will not b there tomorrow, so easyc tests would b best. In response to your other questions we have no potentiometers we just use encoders. The motors generally work except the drive which is powered by a power expander sometimes has some issues


What kind of “issues?”


What you most likely have done is shorted the 5V output that powers the sensors in the analog and digital ports. The two most likely causes are, 1. you plugged something in the wrong was around, perhaps a limit or bumper switch and 2. you have a pinched or damaged wire. Either case could short the 5V supply to gnd, the voltage regulator in the cortex would have gone into a protection mode, it has some type of over current detection but also thermal protection if it becomes very hot, this may have been the “burning” you could smell.

So first you need to make sure the cortex is not damaged by testing all 20 digital and analog ports, you can do this by plugging a bumper switch into each port in turn and checking that it can be detected.

Using EasyC, create a new project and then go into the controller configuration, set all digital ports to inputs (usually just need to change ports 9 through 12). Then download the program, open the online window and check each digital port goes from 1 to 0 when the switch in that port is pushed, don’t try and cut corners, check each one at a time. Do the same for the analog inputs, if all checks out then use a spare motor and perhaps check all the motor ports as well, it’s less likely these are damaged as they have PTC protection.


For ROBOTC it’s pretty much the same technique, use some code like this.

#pragma config(Sensor, in1,    ,               sensorAnalog)
#pragma config(Sensor, in2,    ,               sensorAnalog)
#pragma config(Sensor, in3,    ,               sensorAnalog)
#pragma config(Sensor, in4,    ,               sensorAnalog)
#pragma config(Sensor, in5,    ,               sensorAnalog)
#pragma config(Sensor, in6,    ,               sensorAnalog)
#pragma config(Sensor, in7,    ,               sensorAnalog)
#pragma config(Sensor, in8,    ,               sensorAnalog)
#pragma config(Sensor, dgtl1,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl2,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl3,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl4,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl5,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl6,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl7,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl8,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl9,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl10, ,               sensorDigitalIn)
#pragma config(Sensor, dgtl11, ,               sensorDigitalIn)
#pragma config(Sensor, dgtl12, ,               sensorDigitalIn)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main
    while(1) wait1Msec(10);

Download the code and then use the sensors debug window to check each input goes to (approximately for the analog inputs) 0.


Once you have (hopefully) determined that the cortex is OK, then examine each of the sensor wires in turn and look for any damage. If you find a damaged wire then replace it, otherwise add the sensors back into the cortex one at a time and test each one. If you find one that does not work, remove it from the cortex and test the rest. Replace any wires or sensors you find do not work.

hi ian ! … just to add … if you are having problems like u did at nationals, stop and redo all the wiring because if i remember it was a bit of a mess …

do all wiring one at a time and check when you plug in extenders that it is plugged in correctly … also with the power expander … what problems exactly? … are you using the locking plate correctly ?

Ok, jperman we will do all the things you suggested today and I will let you know the results. As for the power expander the issue is that at times the drive becomes very weak.
As for the wiring, yes it is a complete mess! We will double check the way everything is plugged in and work on making it neater today.

Thanks again


I wasn’t there today but this is what the rest of my team told me.

They followed the tests suggested by Jpearman and they got readings from all the ports using a bumper switch. However, when they plugged back in the encoders and pneumatics they did not work.

At this point they made the decision to swap in the cortex for the last remaining one as we are very short of time. They said they got readings from all the sensors but they then unplugged them to be on the safe side. They have also switched the power expander and there have been no further problems.

Hopefully this is the end to it, apparently if we send the faulty cortex’s back to the head of vex in the UK he will replace them for us ready for next season.

Thanks for all you help I believe we will post a reveal tomorrow. I will also come and find you at some point during the event for a catch up (I remember you did our inspection last year!)


awesome ! … just hope the cortex doesn’t blow … might b an idea to take some money to get another one at worlds incase all goes wrong … just suggest that you check the cabling and get it all secured and so if it goes wrong it is simply plugging in the cables on the cortex …

good look ian, joel, freddie, ellis + Vex Impact !

Happy to help a fellow countryman (yes I’m English and used to live very near to East Barnet when I was at college, I know that area well), still strange that the cortex checked out ok but did not work with the other sensors. Bring it as a spare to Anaheim and perhaps there will be time for a tech to take a look at it.

Im afraid the problem is back…
This morning i came in and i was getting reads from the sensors. It was all workimg fine until i put the lift up to test the IME’s, he encoders all instantly cut out and have not worked since.
We have no cortexs and one day left, what can we do! Wiring is a complete mess but when i get home i will post pics


Since this has happened again, I expect you are experiencing a short as James indicated.

I had a similar problem once on my demo bot. one of my Optical shat encoders stopped reporting. and then a second, Not sure what I had changed in the code I felt the Cortex at one point and it was real hot. I removed power and all of the sensor wires, then I began testing port by port. I had to wait quite a while with the cortex off until I got normal results again. (I believe I left it off for a couple hours).

After I had satisfied myself the ports all worked with a spare encoder. I carefully added my sensors back in one at a time to see if I could find which item might be causing the short. I found a suspect extension wire, replaced it and haven’t had a problem since.

As a result I have a great appreciation for the engineering that goes into making the Cortex so robust ( I thought I had destroyed mine), and I pay attention to the wiring (although I have always tried to keep my wire runs neat) At that time I had every single analog and digital port filled.

My suggestion renew your troubleshooting along the lines James has outlined, and if you find the Cortex works with a bumper switch. start adding your items back one at a time and test each time for little bit to see if your getting readings sensor by sensor.

If as you describe , it was working till you put up the lift, I suspect the motion is stressing some wires and causing a short. you might examine the lift mechanism and if you can identify which sensors are on wires which might be affected by lifting replace those last in your testing and see if you can isolate which sensor (connections) are causing the problem.

Another scenario could be if you are experiencing a short. it just took a while to fail and you noticed it when the arm lifted, just that the timing was ‘wrong’ in a sense.

Take note of the Cortex case temperature. When I had this scenario mine was very hot to the touch.

Best wishes, Keep posting with you results / questions.

Test the alternate Cortexes (the ones you tested with a bumper) with other sensors stand alone. If they function standalone. I highly suspect your wiring to be the issue.

Cheers Kb

hi ian, do me a favour, because you are new with IME … remove them and wire up everything else … then if it works, then add IME !

Liam, my thoughts exactly, we are replacing them with an encoder at the moment, we used fretless’s ideas and discovered that was the problem area.

I am glad to hear you are making progress. I am curious what the root cause will turn out to be. from what you’ve indicated the problem sensors seem to be the IME’s when looking at this post with a block diagram of power distribution on the cortex
the observables would point to the L5973D

When I had my problems I was using an early model Cortex, which I had to replace to get the IME’s to work. What model Cortex do you have? (It’s printed on the bottom of the Cortex)

Also keep in mind when replacing the IME’s with encoders the conflict noted between Port 4 and 10 noted in these two posts:


Cheers Kb](

A short on this would probably stop the cpu from working, however, I remember that there were some reports of shorts inside the IMEs when they were first released so perhaps there is one that has an issue. There is also the possibility that an incorrectly installed IME could cause a short inside. Keep us posted…

Okay, well it’s the end of a long day and we are still having issues.

We removed the IME’s and replaced them with encoders. We tested all the encoders separately and they all worked, we put them together and they still worked. However, when we added in the bumper switches/removed pneumatics they stopped working so we re-added the pneumatics and removed the bumpers.

All worked well and we did some autonomous work, but now the connection cuts out when the lift is extended beyond a certain point. I’m guessing this is due to another short?

Unfortunately, the robot is now with me for programming and I am pretty useless at building however, I need to get this sorted so any advice for how I should go about it?

Sorry I thought we had the problem sorted

P.S. Here are some pictures of our early wiring and robot in general sorry baout wiring we have had to re-do it many times
angled view.jpg
front view.jpg
side view.jpg


What ‘cuts out’ when you extend the arm? is it the sensor readings? or the vexnet connection?
do you have anything plugged into digital 4 and digital 10?

Cheers Kb