AnsweredAssumed Answered

Downloading external program from MC9S12C128 to Avago mouse sensor

Question asked by Jonathan Buwert on Feb 7, 2011
Latest reply on Feb 7, 2011 by pgo

This is the first time I've posted in the forum so hopefully it's in the right bit!


I'm currently writing code in C using Codewarrior for an MC9S12C128 which will control an Avago mouse sensor. I have a 2Kb text file containing ASCII values which make up the configuration program for the mouse sensor. I'm trying to work out the best way to download this data to the mouse chip. I am using SPI from the microcontroller. The first byte of data sent via the MOSI line is the sensor's register, and then the program should be presented on the MOSI line one byte at a time.


I think the best way to do this is to store the program into an array of chars, but I can't work out how to translate a text file with each line containing a 2-character byte into an array without manually copying the ASCII data into Codewarrior. Is there an easy way to do this?