-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
60 lines (48 loc) · 1.19 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* main.cpp
*
* Created on: Feb 26, 2020
* Author: raltmeyer
*
* Main code with setup() e loop() functions
*
* Sample commands
* FWVR
* RDBK:0010
* WRBK:0010:00:11:22:33:44:55:66:77:88:99
* CLBK:0000:002F
*/
#include <Arduino.h>
#include "28c_programmer.h"
#include "pin_defs.h"
const static char msg_start[] PROGMEM = "#START";
//*********
//*
void setup() {
pinMode(PIN_ROM_OE, INPUT_PULLUP);
pinMode(PIN_ROM_WE, INPUT_PULLUP);
// To solve a wrong wire on the first board version
// jumper on the board between these pins:
pinMode(A6, INPUT); //(DO NOT USE) A6 -> D8
pinMode(A7, INPUT); //(DO NOT USE) A7 -> D7
digitalWrite(PIN_ROM_OE, HIGH);
digitalWrite(PIN_ROM_WE, HIGH);
digitalWrite(PIN_SHIFTREG_SER, LOW);
digitalWrite(PIN_SHIFTREG_RCLK, LOW);
digitalWrite(PIN_SHIFTREG_SRCLK, LOW);
pinMode(PIN_ROM_OE, OUTPUT);
pinMode(PIN_ROM_WE, OUTPUT);
pinMode(PIN_SHIFTREG_SER, OUTPUT);
pinMode(PIN_SHIFTREG_RCLK, OUTPUT);
pinMode(PIN_SHIFTREG_SRCLK, OUTPUT);
// Setup of data pins
setDataPinsMode(DATA_PIN_MODE_READ);
// Start serial comm
Serial.begin(57600);
Serial.println(getProgMemString(msg_start));
}
//*********
//*
void loop() {
cmd_processor();
}