LM317 power regulator ajust is affected by MAX485 chip
According to MAX485 datasheet, for DIP/SOP packages the ground goes to Pin5, and +5Vcc goes to Pin8. You seem to have the chip powered upside-down.