abecker,

I think your getting some excellent advice here. As I have said before there are world class programmers here (and also those knowledgeable in electronics design) and all are willing to help.

For all this good advice I think you might owe us some pictures of your train setup and all that
Having a train that actually has an catenary that actually works sounds pretty awesome!
What a fun world to live in, down at the miniature level.
And merging micro controllers and PIC BASIC... what could be better.

You might consider wiring up a length of 6 conductor ribbon cable to the ICSP header then solder it up to a 6 pos header to plug your pickit into.
that way you can easily impliment code changes without having to tear things apart.

Nothing better than to be able to make code changes and test ideas out and see almost instant results.

great stuff!!

now if you have a few minutes check out this...
http://hackaday.com/2016/01/17/the-s...ur-wunderland/
It is awesome to go to google earth and get down in minature and roam around this model setup.