I had seen the other thread, but I was hoping to leave the legacy header available for another purpose. Nonetheless, I soldered a female header into the ICSP location, after being sure to omit the power contact from its location, and the sketch ran fine just like that.
I left the CS line on D10, and everything else stayed the same. I do not know why the SPI and/or SD libraries would not work with the D10-D13 location, but I figure there must be something specific to the workings of one or both of those libraries that allows it to only work with the ICSP/Legacy SPI port. Nonetheless, it is working reliably (and fast!) and I already have the sketch for parsing the data files working and giving me just the numbers I need in the correct order and format. Now on to the rest of the project!
If I may share a bit of the history and purpose of this project, it involves replacing/updating/streamlining the navigation system I had built many years ago for my entry into the original DARPA Grand Challenge offroad autonomous vehicle competition (Rob Meyer Productions - Coyote UGV). The original platform had a ruggedized laptop computer connected by serial (RS-232) to a BasicX-01 microcontroller which acted as an interface for a number of other microcontrollers (over a RS-485 network) running two Doppler Radar sensors, three Sonar sensors, a Scanning Laser Rangefinder, a Fluid Stabilized Magnetic Compass, a GPS Receiver and Differential Beacon Receiver, a CMU Cam Vision Sensor, and two Bumper Contact Sensors.
In order to overcome some bi-directional communication conflicts with the RS-232 connection between the laptop and the microcontroller interface side which worked, albeit slowly, I eventually built a simple parallel-to-series converter out of another BasicX-01 and then ran all of my control outputs from the laptop’s parallel printer port out to where the converted serial outputs then fed into a serial servo controller, which ultimately controlled the closed-loop steering servomotor, the brake motor, the E-brake air solenoid, the throttle, and the automatic transmission gear select servomotor. For whatever reasons which are beyond my understanding, I just figured out through experimentation that I could achieve lower latency by keeping all of the inputs on the laptop’s serial port, and running all of the control outputs through the parallel port.
I was able to build the system and have it running autonomous GPS courses by the second season’s event and I actually passed some of the preliminary portions of the competition, but by the time of the site-visit-demonstration portion, I had the car running GPS courses, but it still had no real functioning obstacle avoidance measures, which eventually led to my being eliminated from the competition at that stage.
I kept the vehicle, as well as the smaller “Javelina” autonomous rover which was electrically identical to the larger car, and which was thus used as the primary test vehicle for the larger system, and I continued to work to complete the obstacle avoidance features and test/optimize the system. Even though the larger car now sits unused in my shop, the smaller go-cart sized Javelina vehicle is now being pressed into service here on our farm as an autonomous bird-deterrent vehicle in our vineyards. I have it programmed to run routes along the outside edge of the vineyards, periodically sounding a 12-Volt air-horn to keep the birds from picking our ripening fruit off the vines. This is proving to be a great practical use for the little GPS-Guided car, as it frees me from having to take the time to drive around dealing with the birds myself. (of course we do employ other humane bird deterrent measures, but it usually takes a variety of approaches to achieve real effective control).
So what I am working on now is to replace the laptop computer on this little vehicle with a microcontroller-based system. I had originally equipped the car with the laptop as the central controller, because already having a display, disc drives, keyboard and communication ports, it made loading route data, programming the navigation algorithms, and reading the system states and debugging a fairly quick and simple task.
The laptop, though, is very old and tired now, and even though it is a tough little machine (Toshiba Satellite 2535CDS), I am afraid the rough roads out here on the farm will eventually take their toll. So I am porting the whole system onto a RedBoard Turbo SAMD21 Board. The SAMD21 has plenty of processing power to run the navigation program, it is now connected to a GPS logger shield, so the SD card reader can replace the need for disk drive route data storage, and I have it connected to a 4D systems LCD Display, so all of the essential functions of the original laptop have now been assimilated by this new system which is smaller, lighter, more durable, and more power efficient than the laptop was.
I am sure by now you might be thinking “Why not just go with a single board computer, Raspberry Pi or such??” The short of it is that for now those are beyond my skillset.
The only physical tasks left are to configure and additional UART port on the RedBoard to interface back to the cars’s microcontroller network through a MAX-232 or similar driver, and to configure and program some of the remaining digital pins on the redboard to function as an eight-bit parallel port. While it may sound cumbersome to emulate the serial and parallel ports from the laptop, I am doing so in order to make the swap between the laptop and the new RedBoard a Plug-and-Play situation. I do not want to alter the existing electronics or firmware on the original system in any way.
Even though I could certainly upgrade and streamline every aspect of the system, network, and sensors, it works fine at the speeds and purposes I am now using it for, so I decided to retain all of the now obsolete tech and just concentrate on building a more robust central processor . At the time I built the original system, I could have never imagined having a single microcontroller that could handle all of these tasks with any efficiency- at least not one that I would be capable of working with!
I suppose I might port this post onto one of the project forums in here so I can share more as I work to complete the project. Thanks for the guidance on the SD card reader issue- it is working great.