forked from Larswad/uno2iec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
executable file
·266 lines (211 loc) · 10.5 KB
/
notes.txt
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
--------------------------------------------------------
Raspberry PI specific Stuff, if used as host system.
--------------------------------------------------------
Use the following guide for disabling COM port on PI under raspbian:
http://www.hobbytronics.co.uk/raspberry-pi-serial-port
Basically do:
disable login:
sudo nano /etc/inittab
This file has the command to enable the login prompt and this needs to be disabled. Edit the
file and move to the end of the file. You will see a line similar to
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Disable it by adding a # character to the beginning. Save the file.
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Disable Bootup Info
-------------------
When the Raspberry Pi boots up, all the bootup information is sent to the serial port.
Disabling this bootup information is optional and you may want to leave this enabled as it
is sometimes useful to see what is happening at bootup. If you have a device connected (i.e.
Arduino) at bootup, it will receive this information over the serial port, so it is up to
you to decide whether this is a problem or not.
You can disable it by editing the file /boot/cmdline.txt
The contents of the file look like this
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Remove all references to ttyAMA0 (which is the name of the serial port).
The file will now look like this
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
REBOOT!
test that this works with minicom:
minicom -b 9600 -o -D /dev/ttyAMA0
------------------------------------------------------
How to test the ATN, CLOCK, DATA lines from CBM basic:
------------------------------------------------------
10 A=56576
20 POKE A,PEEK(A) AND (255 - 8 - 16 - 32)
30 PRINT PEEK(A) AND 192
40 GOTO 30
---------------------------------------------------------
For ttyACM0 access without sudo on ubuntu (or derivates).
---------------------------------------------------------
sudo usermod -a -G tty yourUserName
sudo usermod -a -G dialout yourUserName
----------------------------------------------------------------------------------------------
Arduino to Host command protocol description:
----------------------------------------------------------------------------------------------
At bootup, Arduino tries continuously to connect to host with:
connect_arduino:<protocol_version><CR>
response should from host when ready then be (if protocol matches):
OK><deviceNumber>|<atnpin>|<clockpin>|<datapin>|<srqinpin>|<resetpin>|yyyy-mm-dd.hh:mm:ss<CR>
Whereupon client could set the pin configuration according to the returned string.
But if protocol mismatch the host should return:
NOK><CR>
The control characters may ONLY be capital letters A-Z or special characters like '!'.
Send debug string to host
D<severityId><facilityId><debug msg string><CR>
The severityId is one byte consisting of either 'S', 'I', 'W' or 'E'
The facilityId is a single id of a previously registered facility.
Register facility with abbreviating character and corresponding string to expand to on host side.
!<abbreviationChar><facilityString><CR>
IEC open/command, the command string is just like from the IEC interface. First byte is 'O', second byte is the TOTAL length including the first 'O'.
The command has not zero or CR termination. The third byte is the channel (0-15), at the fourth byte begins the actual command string.
The code returned is according to the values of the IOErrorMessage enum.
Request: O<BYTE length><BYTE channel><command string BYTE 0..n>
Response: ><code><CR>
Read byte(s) from current file of current (last selected) file system type.
Current byte read/write byte number size determines number of bytes in sequence.
The host returns 'B' followed by the byte(s) being read, or answers with 'E' if end of file has been reached.
Request: 'R'
Response: B<BYTE NumBytes><Byte 0..n>
Or Response: E<BYTE NumBytes><Byte 0..n>
Request: 'N'<buffer size>
Response: Same as for 'B' request but changes the returned payload count (and also for subsequent 'B' requests).
Write byte(s) to current file of current (last selected) file system type.
Current byte read/write byte number size determines number of bytes in sequence.
Request: W<BYTE NumBytes><BYTE 0..n>
(no response expected, full speed transfer and host side is expected to accept all data received).
Close file for current file system on host side. Host will return name string of last loaded or saved file.
If responding with 'N' last operation was load, if responding with 'n' it was a save oepration.
Request:'C'
Response: 'N'<BYTE NumBytes><BYTE 0..n of name>
or: 'n'<length><name>
'L' request for sending next directory / information line.
Response: 'L'<BYTE length><line data>
This response cannot have line data more than 255 chars since the length for each line is specified by a byte.
The line data includes the basic address.
If 'l' is returned, there was no more data
--------------------------------------------------
CBM syntax:
--------------------------------------------------
LOAD"<<",8 Reset interface and communication state. Do this if there is problem with PC to arduino sync.
Read < as the petscii back-arrow.
LOAD "!!",8
Retreive information about the current used file system / image.
In Nativs FS mode: (the default mode)
LOAD "*",8 Load the first file from the current disk image or the native fs.
LOAD"$",8 Gets directory listing, equivalent to LOAD".",8
Loads the current directory, either inside an image or the native fs.
LOAD"gamesdir",8 Enter the "gamesdir" directory, and get listing.
LOAD"..",8 Up one directory and get directory listing.
LOAD"tetris.prg",8 Loads the "tetris.prg" program file.
SAVE"example.prg",8 Save into "example.prg" which is a native fs file.
LOAD"disk.d64",8 Loads the disk.d64 disk image and enters D64 mode.
LOAD"tape.t64",8 Loads the tape.t64 tape image and enters T64 mode.
LOAD "FILE.M2I",8 Move into a M2I "image" and load the list of contained native fs files.
In D64 mode:
Load "$", "*" wildcards, filenames works (almost) as espected on a 1541.
LOAD"<",8 (back-arrow). Escape D64 mode, and back to FAT mode.
SAVE"abc",8 Fools the CBM, but has no effect. Saves in D64 are
not implemented
In T64 mode:
Load "$", "*" wildcards, filenames works as if it was a D64.
LOAD"<",8 (back-arrow). Escape T64 mode, and back to FAT mode.
SAVE"abc",8 Fools the CBM, but has no effect.
NOTE:
-----
The FILE NOT FOUND ERROR is used to message both the original meaning, but
it is also used to inform if there is an error with the host communication or filesystem.
Try a LOAD"<<",8 to try going into initial state.
1541 original commands implemented / to implement (X means implemented and working).
------------------------------------------------------------------------------------
UI- / UI+: Switch to VIC20 / VIC64 speed
NEW:name,id (abbreviated N:name,id) If id is left out directory is just cleared.
COPY:newfile=oldfile (abbreviated C:newfile=oldfile) If oldfile is several comma separated names they are concatenated.
RENAME:newfile=oldfile (abbreviated R:newfile=oldfile)
SCRATCH:filename (abbreviated S:filename) If oldfile is several comma separated names they are concatenated.
INITIALIZE (abbreviated I) Initialize drive (reset states)
VALIDATE (abbreviated V) Reorganize drive, like defragment
PRINT#file#, "BLOCK-READ:" channel; drive; track; block (abbreviated PRINT#file#, "B-R:" channel; drive; track; block
PRINT#file#, "BLOCK-WRITE:" channel; drive; track; block (abbreviated PRINT#file, "B-W:" channel; drive; track; block)
PRINT#file#, "BLOCK-ALLOCATE:" drive; track; block
PRINT#file#, "BLOCK-FREE:" drive; track; block (abbreviated PRINT#file#, "B-F:" drive; track; block
PRINT#file#, "B-P:" channel; position To set buffer pointer
PRINT#file#, "P" CHR$(channel#) CHR$(rec#lo) CHR$(rec#hi)CHR$(position) Set position in REL files
PRINT#file#, "U1:" channel; drive; track; block (abbreviated PRINT#file#, "UA:" channel; drive; track; block) USER1 command
PRINT#file#, "U2:" channel; drive; track; block (abbreviated PRINT#file#, "UB:" channel; drive; track; block USER2 command
PRINT#file#, "M-R" CHR$(low byte of address) CHR$(high byte) memory read
PRINT#file#, "M-W" CHR$(low address byte) CHR$(high address byte)CHR$(#-of-characters) byte data memory write
PRINT#file#, "M-E" CHR$(low address byte) CHR$(high byte) memory execute
PRINT#file#,"M-W:" CHR$(119) CHR$(0) CHR$(2) CHR$(address+32)CHR$(address+64) change device number
X LOAD PROGRAM WILDCARD support working?
SAVE PROGRAM Must handle save with replace, @0:filename
sdi2ec support:
---------------------------------------------
Changing directories (CMD syntax):
OPEN1,8,15,"CD/SOMEDIR/":CLOSE1 - change to SOMEDIR (relative, in uno2iec relative to current directory)
OPEN1,8,15,"CD//":CLOSE1 - change to root directory (In Uno2iec this root means: base path)
OPEN1,8,15,"CD//SOMEDIR/":CLOSE1 - change to SOMEDIR (in root)
OPEN1,8,15,"CD:←":CLOSE1 - go to parent directory
Using M2Is or D64s:
OPEN1,8,15,"CD//SOMEDIR/:SOMEGAME.M2I":CLOSE1 - change to/mount SOMEGAME.M2I
OPEN1,8,15,"CD//SOMEDIR/:SOMEGAME.D64":CLOSE1 - change to/mount SOMEGAME.D64
OPEN1,8,15,"CD:←":CLOSE1 - leave M2I/D64
Loading files:
LOAD"//SOMEDIR/:SOMEFILE" - load SOMEFILE in SOMEDIR (filename gets separated from path using colon)
Change device address
Change device address:
OPEN1,current address,15,"U0>"+CHR$(new address):CLOSE1 - change sd2iec device number to new address
OPEN1,device address,15,"XW":close1 - this will save settings to eeprom (required if you want to set new device address as default)
files of interest in sd2iec:
----------------------------
buffers.c/.h
d64ops.c /.h
m2iops.c / .h
p00cache.c / .h
dirent.h
doscmd.c / .h
errormsg.c / .h
fileops.c / .h
flags.h
iec-bus.h
iec.c / .h
parser.c / .h
fastloader.c / .h
avr/
crc.h
crc7asm.h
fastloader-ii.S
arch-config.h
arch-timer.c / .h
atomic.h
avrcompat.h
files of little interest in sd2ec:
----------------------------------
config.h
eeprom.c /.h
main.c
led.c / .h
timer.c / .h
utils.c / .h
wrapops.h
files of NO interest in sd2iec:
-------------------------------
ata.h
bus.h
diskchange.c / .h
diskio.c / .h
display.c /.h
ds1307-3231.c / .h
pcf8583.c / .h
rtc.c /.h
rtc_lpcl7xx.h
ieee.c / .h
integer.h
ff.c / .h
i2c.h
sdcard.c / .h
softrtc.h
system.h
time.h
uart.h
ustring.h
lpc17xx/*