problems with pin 22-53 arduinomega - processing

Firmata and the Mega do not play well together. Ditch Firmata and write your own protocol to get data from/to the Arduino.