While I am thinking of it.
1. Do the pins on Arduino have other uses that could effect this program.
2. Using Intel hex properly, think you need a full line at a time in Arduino.
This keeps Arduino's ram use low while allowing easy programming using this format.
You will probably want the following.
Rraspberry pi intel hex Input/output to Arduino ram, one line at a time.
Arduino input/output to ram chip or rom chip would then be to/from Arduino ram. Using an array for this data makes program shorter and easer to change/read.
Would be good idea to have functions that take data or return data to make it easer to work with the data in Arduino ram.
This code
// memory data buss
const int Pin_Data_D0 = 2; // Data 0
const int Pin_Data_D1 = 3; // Data 1
const int Pin_Data_D2 = 4; // Data 2
const int Pin_Data_D3 = 5; // Data 3
const int Pin_Data_D4 = 6; // Data 4
const int Pin_Data_D5 = 7; // Data 5
const int Pin_Data_D6 = 8; // Data 6
const int Pin_Data_D7 = 13; // Data 7
void Byte_to_Mem_Data_Buss(){
// Writing Values into Memory
digitalWrite(Pin_Data_D7, bitRead(Data_Byte, 7));
digitalWrite(Pin_Data_D6, bitRead(Data_Byte, 6));
digitalWrite(Pin_Data_D5, bitRead(Data_Byte, 5));
digitalWrite(Pin_Data_D4, bitRead(Data_Byte, 4));
digitalWrite(Pin_Data_D3, bitRead(Data_Byte, 3));
digitalWrite(Pin_Data_D2, bitRead(Data_Byte, 2));
digitalWrite(Pin_Data_D1, bitRead(Data_Byte, 1));
digitalWrite(Pin_Data_D0, bitRead(Data_Byte, 0));
}
could be this code using arrays
int Pins_Data_Buss[] = {2, 3, 4, 5, 6, 7, 8, 13}; // memory data buss pins D0 .. D7
void Byte_to_Mem_Data_Buss(){
// Writing Values into Memory
for (int i=0; i <= 7; i++){
digitalWrite(Pins_Data_Buss[i], bitRead(Data_Byte, i));
}
}
And when you pass the data into function becomes this
void Byte_to_Mem_Data_Buss(byte Data_Byte_in){
// Writing Values into Memory
for (int i=0; i <= 7; i++){
digitalWrite(Pins_Data_Buss[i], bitRead(Data_Byte_in, i));
}
}
Due to the pin numbers being in an array addressed 0 to 7, many parts of program get a lot shorter while program gets easer to check for errors.
Changing i in loops above to Bit_Number could be an additional step.