Skip to content

Commit 7ecb749

Browse files
committed
Initial commit
0 parents  commit 7ecb749

6 files changed

Lines changed: 1435 additions & 0 deletions

File tree

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.asm
2+
*.bin
3+
*.crt
4+
*.d64
5+
*.int
6+
*.lbl
7+
*.map
8+
*.prg
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#include <DMXSerial.h>
2+
3+
#define PC2 7
4+
#define PA2 15
5+
6+
#define LED 17
7+
#define IRQ_DEBUG A2
8+
9+
volatile uint8_t _state = 0;
10+
volatile uint16_t _address = 0;
11+
volatile uint8_t _len = 0;
12+
13+
void receiveByte() {
14+
digitalWrite(IRQ_DEBUG, HIGH);
15+
uint8_t b = PINB;
16+
uint8_t c = PINC;
17+
uint8_t d = PIND;
18+
// PB3, PB2, PB6, PB5, PB4, PD7, PC6, PD4
19+
// PB1
20+
uint8_t rec = ((b & 0x0c) << 4) | ((b & 0x70) >> 1) | ((d & 0x80) >> 5) | ((c & 0x40) >> 5) | ((d & 0x10) >> 4);
21+
if ((b & 0x2) == 0) {
22+
_address = rec;
23+
digitalWrite(LED, LOW);
24+
_state = 1;
25+
} else if (_state == 1) {
26+
_address = (_address << 8) | rec;
27+
_state = 2;
28+
} else if (_state == 2) {
29+
_len = rec;
30+
_state = 3;
31+
} else if (_state == 3) {
32+
DMXSerial.write(_address, rec);
33+
_address++;
34+
_len--;
35+
if (_len == 0) {
36+
digitalWrite(LED, HIGH);
37+
_state = 0;
38+
}
39+
}
40+
digitalWrite(IRQ_DEBUG, LOW);
41+
}
42+
43+
void setup() {
44+
pinMode(PC2, INPUT);
45+
pinMode(PA2, INPUT);
46+
pinMode(4, INPUT); pinMode(5, INPUT); pinMode(6, INPUT); pinMode(8, INPUT); pinMode(9, INPUT); pinMode(10, INPUT); pinMode(14, INPUT); pinMode(16, INPUT);
47+
pinMode(7, INPUT);
48+
attachInterrupt(digitalPinToInterrupt(PC2), receiveByte, FALLING);
49+
pinMode(LED, OUTPUT);
50+
digitalWrite(LED, HIGH);
51+
pinMode(IRQ_DEBUG, OUTPUT);
52+
digitalWrite(IRQ_DEBUG, LOW);
53+
54+
DMXSerial.init(DMXController);
55+
}
56+
57+
void loop() {
58+
}

Arduino/NodleR4sUltimate/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Nodle R4S ULTIMATE #
2+
3+
This is a do-it-yourself DMX 512 interface to be connected to the user port of a Commodore C64.
4+
It uses a Sparkfun Pro Micro (or compatible) and the Arduino framework.
5+
6+
## Pinout ##
7+
8+
| **C64 User Port** | **Pro Micro** |
9+
|:-----------------:|:-------------:|
10+
| 1 | GND |
11+
| 2 | VCC |
12+
| 8 | 7 |
13+
| C | 4 |
14+
| D | 5 |
15+
| E | 6 |
16+
| F | 8 |
17+
| H | 9 |
18+
| J | 10 |
19+
| K | 16 |
20+
| L | 14 |
21+
| M | 15 |
22+
23+
Pin TXO of the Pro Micro is the DMX Out and needs to go to a RS485 Transceiver (e.g. SN75176) and then out to the DMX bus.

demo.seq

3.35 KB
Binary file not shown.

0 commit comments

Comments
 (0)