Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/josejx/josejx.net/collie/index.php:1) in /hsphere/local/home/josejx/josejx.net/collie/index.php on line 341

Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/josejx/josejx.net/collie/index.php:1) in /hsphere/local/home/josejx/josejx.net/collie/index.php on line 342
Init

Init

Front Page Edit Recent Changes All Pages Find Page

Initializing the Bus

Install IRQs

  1. Unset bit 0x8000 in LoCoMo GPIO Direction and LoCoMo GPIO Output/Enable
  2. Set bit 0x2000 in LoCoMo GPIO Direction, LoCoMo GPIO Output/Enable and LoCoMo GPIO Rise and Fall direction

Open SD Register Access

  1. Set bit 0x2000 in LoCoMo GPIO Direction and LoCoMo GPIO Output/Enable
  2. Set bit 0x4000 in LoCoMo GPIO Direction and LoCoMo GPIO Output/Enable
  3. Unset bit 0x8000 in LoCoMo GPIO Direction and LoCoMo GPIO Output/Enable
  4. If bit 0x2000 isn't set in LoCoMo GPIO Level, set bit 0x8000 in LoCoMo GPIO Level and delay for 100mS.
  5. Write 0x6C14 to LoCoMo SPI Mode Setting
  6. If bit 0x2000 in LoCoMo GPIO Level is set, set bit 0x80 in LoCoMo SPI Mode Setting, then set bit 0x40 in LoCoMo SPI Mode Setting
  7. Write 0x40 to LoCoMo Mode Control
  8. Set bit 0x80 in LoCoMo Mode Control
  9. Delay for 200uS
  10. Read the value of LoCoMo SPI Control and write it back
  11. Set bit 0x1 in LoCoMo SPI Control
  12. If bit 0x2000 in LoCoMo GPIO Level isn't set, TX a CardResetSequence to the card
  13. Unset bit 0x40 in LoCoMo SPI Control

Close SD Register Access

  1. Unset bit 0x80 in LoCoMo SPI Mode Control (0x64)
  2. Unset bit 0x40 in LoCoMo SPI Mode Setting (0x60)
  3. Unset bit 0x80 in LoCoMo SPI Mode Setting (0x60)
  4. Set bit 0x40 in LoCoMo SPI Mode Control (0x64)
  5. Unset bit 0x8000 in LoCoMo GPIO Out Data Setting
  6. Delay for 2 seconds (!)