Tell us about yourself!
Maybe the cause of the random noise using the Arduino sketch is due to the use of delayMicroseconds () function. The function itself has a certain execution time which cannot be neglected. When working with such short pulses (0.5 milliseconds) execution time for other functions must be kept to a minimum amount.
DIY RAM Memory- Register Style
Microcontroller Register Manipulation
Raspberry Pi and Arduino LCD