Commit graph

165 commits

Author SHA1 Message Date
Jeff Epler
c104c92a86 Doxygen needs to know where to look for the image 2022-04-18 11:41:53 -05:00
Jeff Epler
145efdb695 clang-format 2022-04-18 11:33:07 -05:00
Jeff Epler
2421b2be81 Add some text on the front page of the docs 2022-04-18 11:07:54 -05:00
Jeff Epler
602a489d46 remove straggler file 2022-04-18 09:13:45 -05:00
1841d0f0c2
Merge pull request #16 from jepler/applefloppyflux
Add Apple Disk ][ Flux Writing for rp2040
2022-04-16 12:54:52 -05:00
2629a9742b
fix doxygen 2022-04-12 08:59:31 -05:00
b43c9764db
document constructor parameter 2022-03-30 12:30:07 -05:00
7851e7574a
fix return code from write_track 2022-03-30 12:29:28 -05:00
27a4abf6b4
Fix flux writing, implement GETFLUXSTATUS better
I initially thought (and didn't test) that an error from
fluxwrite could be signaled in place of the initial ACK
but in the protocol this ACK has to be written before the
flux is sent from the PC. So, save the result and use it down
in GETFLUXSTATUS instead.
2022-03-30 12:28:25 -05:00
c6e5044488
Add Apple Disk ][ Flux Writing for rp2040
The Apple Disk ][ produces a flux transition whenever the
WRDATA signal has a transition, rather than on only one edge.
This needs different low-level writing code than a PC drive.

We can implement it later for samd51 or bitbang if needed.
2022-03-30 11:36:47 -05:00
7f66508cd8
Merge pull request #15 from jepler/applefloppy
Add support for Apple II Floppy drives such as Disk ][
2022-03-15 12:43:22 -05:00
2b67aa391e
samd build fixes 2022-03-15 11:35:11 -05:00
680197ded5
Fix write-protect sensing
To ensure it's OK to activate winding 0, it's necessary
to go to a quartertrack that is a multiple of 8, not just 4.

The previous version of code could lead to loss of position when
the write-protect sense was read while the full track was
an odd number: 1, 3, ...
2022-03-15 08:59:20 -05:00
6bf313acff
rp2040: Disable interrupts a skosh earlier
.. this helps get the state machine fifo good and packed,
avoiding a glitch during the first byte of the track.

Also superstitiously disable the PIO instance, even though it
should have been disabled already.
2022-03-15 08:59:20 -05:00
48e1309e69
apple2: fix pinout 2022-03-15 08:59:19 -05:00
c6227a80e8
Fix flux reading when index pulse doesn't come
It's possible for `capture_track` to return early, in the
case that the buffer is small relative to the track time
(or something else is going wrong, like no index pulse).

However, in this case the flux sending loop would never exit,
but would index beyond the end of the flux_transitions array
and probably HardFault eventually.

Instead, use (-1) as the sentinel value for 'no index pulse arrived'
and break out of the loop.
2022-03-15 08:59:19 -05:00
8d38c01185
apple2floppy: Show write protect status in flux capture demo 2022-03-14 16:54:15 -05:00
77de2e119b
Apple2Floppy: fix polarity of write protect signal 2022-03-14 16:53:41 -05:00
c50785c897
clang a bit more; provide pin definitions (unteseted) for feather m4 2022-03-10 16:22:18 -06:00
c21929b34b
doxygen improvements 2022-03-10 16:07:40 -06:00
e38f380fc6
std::end is not available for samd51 2022-03-10 16:02:54 -06:00
1508b08997
Add support for apple2 floppy drives to the greaseweazle sketch
.. this involves making some refinements to the floppy base class
as well.
2022-03-10 13:33:37 -06:00
98c4b2d098
doxify 2022-03-09 12:02:10 -06:00
9c7e3ff22c
Get apple2 reading working, add example 2022-03-09 11:47:59 -06:00
bd1669e8b0
apple floppin code is syntactically valid, not tested on hw yet 2022-03-08 17:36:27 -06:00
00cfcf1963
rp2: fix return valaue of capture_foreground() 2022-03-08 16:51:39 -06:00
d6dc0fe043
Factor out base class
... in preparation for one that does apple floppin'
2022-03-07 17:57:45 -06:00
5d1e32d7f1
Merge pull request #12 from jepler/revamp-ci
Create artifacts for greaseweazel and msd examples
2022-02-11 16:22:25 -06:00
b650a78743
fix checkout path of the ci scripts 2022-02-11 12:59:02 -06:00
1587684f3e
examples: reformat all with ctrl-t in arduino ide 2022-02-11 09:42:38 -06:00
a71f107556
greaseweazel: improve index pulse recording
ripping with genuine GW hardware, a typical track is read in
to gw as
```
Flux: 72.00 MHz
 Total: 232202 samples, 594.17ms
 Revolution 0: 93.06ms
 Revolution 1: 166.87ms
 Revolution 2: 166.87ms
 Revolution 3: 166.87ms
```

our firmware came in as
```
Flux: 24.00 MHz
 Total: 120485 samples, 652.35ms
 Revolution 0: 0.00ms
 Revolution 1: 162.34ms
 Revolution 2: 55.11ms
 Revolution 3: 162.17ms
 Revolution 4: 55.28ms
 Revolution 5: 162.12ms
```
Notice how there's an empty revolution 0 and a partial revolution
2 & 4.

It appears that
 * if capture_ms is 0, nothing is captured after the index
   (rather than 50ms)
 * no index is emitted at the start (though this is because
   the first revolution is almost always a partial revolution)

Now after this change, a track on rp2040 looks like
```
Flux: 24.00 MHz
 Total: 96498 samples, 502.46ms
 Revolution 0: 0.00ms
 Revolution 1: 167.49ms
 Revolution 2: 167.49ms
 Revolution 3: 167.49ms
```
which appears to be closer to what gw expects; it also fixes how
g64conv used to require `r1` to select a particular revolution.
This may have been because it defaulted to one of the 'runt'
revolutions, which also made it misestimate the rotational speed
of the drive.
2022-02-10 20:05:04 -06:00
87785ae5ff
rp2040: move index handling out of pio, correct falling_index_offset 2022-02-10 19:59:35 -06:00
ab501a60d2
Merge pull request #11 from adafruit/samd51_capturetimer
Implement timer based capture on samd51, pio based capture on rp2040
2022-02-10 13:20:57 -06:00
cd0c08142e
Let's upload some artifacts 2022-02-10 13:18:35 -06:00
d18495d298
Remmove F_CPU warnings, they are irrelevant now 2022-02-10 09:53:46 -06:00
311c7798fb
GW firmware is unreliable unless Adafruit TinyUSB is used 2022-02-10 09:50:19 -06:00
a400e0b8e2
remove standalone mfm test program, is no longer needed 2022-02-09 17:49:25 -06:00
178792a525
Fix greaseunpack for 2-byte codes
it was off by 250.
2022-02-09 17:48:38 -06:00
c78b45ba9d
Remove some debug printing
.. this caused a problem when the flux bins were >512, I think.
2022-02-09 17:48:18 -06:00
b7754468c5
remove unused wait_index, stop_index 2022-02-09 16:47:19 -06:00
67bc164530
fix header 2022-02-09 16:47:10 -06:00
43e02a5545
no more mhz warning for rp2040 2022-02-09 16:46:59 -06:00
e4a29020be
Fix capture
.. after awhile it would run out of program space, because
it was not freeing the right program.

also add support for terminating a read after a given number
of ms, or 50ms after the second index pulse.
2022-02-09 13:45:06 -06:00
lady ada
0908c92ab5 fix 0 revs is 0 revs 2022-02-08 18:16:15 -05:00
46166ace07
mark functions as private to quiet doxygen 2022-02-08 16:47:53 -06:00
ef7eca9d02
Merge remote-tracking branch 'origin/samd51_capturetimer' into samd51_capturetimer 2022-02-08 16:42:50 -06:00
afe73d8039
rp2040: implement flux writing
This nearly works with fluxengine (slightly older revision):
```
$ ./fluxengine write ibm1440  -i bloop.img  --usb.serial=...
Measuring rotational speed... 200ms
Writing to: drive 0
  0.0: Write:   199 ms in 76988 bytes
       Verify:  391 ms in 150010 bytes
  0.1: Write:   199 ms in 92225 bytes
       Verify:  326 ms in 150006 bytes
  1.0: Write:   199 ms in 79272 bytes
       Verify:  380 ms in 150002 bytes
```
but at some point, the fw and fluxengine stop successfully
talking:
```
Measuring rotational speed... 200ms
Writing to: drive 0
  0.0: Write:   199 ms in 76988 bytes
       Verify:  391 ms in 150010 bytes
  0.1: Write:   199 ms in 92225 bytes
       Verify:  326 ms in 150006 bytes
  1.0: Write:   199 ms in 79272 bytes
       Verify:  380 ms in 150002 bytes
```
2022-02-08 16:42:46 -06:00
lady ada
7db1daa364 some doxyclang 2022-02-08 12:01:14 -05:00
lady ada
b41052ba75 Merge branch 'samd51_capturetimer' of github.com:adafruit/Adafruit_Floppy into samd51_capturetimer 2022-02-08 11:41:11 -05:00
lady ada
4d062e5244 allow writing long fluxes, fix for 'capture by time not revs' 2022-02-08 11:41:05 -05:00