Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Write the disable protection code, to allow writing
- void disable_protection()
- {
- turn_on(OE);
- turn_on(WE);
- turn_off(CE);
- io_output();
- s_byte(0xAA, 0x5555);
- turn_off(CE);
- s_byte(0x55, 0x2AAA);
- turn_off(CE);
- s_byte(0x80, 0x5555);
- turn_off(CE);
- s_byte(0xAA, 0x5555);
- turn_off(CE);
- s_byte(0x55, 0x2AAA);
- turn_off(CE);
- s_byte(0x20, 0x5555);
- io_input();
- turn_on(CE);
- Serial.print("The protection has been removed");
- }
- // This is a special function, which allows writing a byte without checking if the write is done yet.
- void s_byte(uint8_t data, uint16_t addr)
- {
- // When adding the third shift register, this code will be changed
- aanstaanden = addr;
- shift_a_byte(aanstaanden);
- put_io(data);
- turn_off(WE);
- delayMicroseconds(1);
- turn_on(WE);
- turn_on(CE);
- }
Advertisement
Add Comment
Please, Sign In to add comment