Commit Graph

62 Commits

Author SHA1 Message Date
Byron Lathi
2c6f333966 Remove unused char c 2022-04-16 14:02:43 -05:00
Byron Lathi
246d7a5e6f Print out more information, read a file
Prints out information about the drive, now inside its own function.

Also changes the read function to take in a 32 bit address instead of a
16 bit one.

Attempts to read the first file on the disk
2022-04-14 17:04:47 -05:00
Byron Lathi
380550c77d Add more struct definitions
Adds filesystem info struct and directory entry structs
2022-04-14 17:04:08 -05:00
Byron Lathi
7df0b67b12 Print out information about the sd card filesystem.
Prints out all of the parameter blocks for the SD card.
2022-04-14 13:50:14 -05:00
Byron Lathi
3c68e4584f Add some definitions for FAT32 file system
Adds some struct types for the FAT32 file system.

This just includes the information in the parameter blocks, not any
actual files.
2022-04-14 13:49:11 -05:00
Byron Lathi
d140928148 Add testing function for reading sd blocks
Add a simple function which reads a 512 block from the SD card and then
prints it to the console.
2022-04-14 11:23:44 -05:00
Byron Lathi
f4e16c0c12 Add software interface for reading SD card data
Adds functions to wait for data to be read, and to read data form the sd
card controller.
2022-04-11 14:03:42 -05:00
Byron Lathi
9eaa6c49f9 Add software support for sd response codes
Polls the sd controller until the read flag is set, at which point it
reads 32 bits of data from the controller.

long response codes (such as CID) are not supported in hw or sw.
2022-04-10 23:18:26 -05:00
Byron Lathi
385efb2511 Read some data off of the sd card
These series of commands are enough to read the first 512b block off of
the sd card. The RCA is hard coded to the sd card that I have on hand,
since response codes are not supported
2022-04-10 19:34:38 -05:00
Byron Lathi
7092cc8f77 Add SD card software interface
Adds a function to send a command to the sd card.
2022-04-10 17:55:51 -05:00
Byron Lathi
0752cc4b8c do a little test to see if memory mapping works
This code creates a shared mapping in high ram, makes sure that that
works, and also makes sure that the memory which is mapped over is left
unchanged.
2022-04-07 12:43:47 -05:00
Byron Lathi
35040860e7 Identity map memory upon reset
Upon reset the mapper is set to identity map and then enabled.
2022-04-07 10:36:50 -05:00
Byron Lathi
a15dde0e89 Add memory mapper software interface
Adds functions to read and write mappings, as well as enable and disable
the memory mapper.

This also moves increases the io space by 16 bytes.
2022-04-07 10:33:50 -05:00
Byron Lathi
af60d32679 Remove RAM memory section
Replace RAM section with SDRAM.

Really this makes no difference than before we added SDRAM except the
name is different. In hardware, the SDRAM acts the same way and is
located in the same space as the RAM was previously.
2022-03-21 14:06:12 -05:00
Byron Lathi
5c32fe808e Add board-io, replace sevenseg in sw 2022-03-18 01:27:55 +00:00
Byron Lathi
7619c7c54f new testing program 2022-03-17 15:05:37 -05:00
Byron Lathi
bbba99d099 Move data data segment to SDRAM 2022-03-17 15:05:25 -05:00
Byron Lathi
2a1f8df54e Create SDRAM memory region 2022-03-17 13:37:34 -05:00
Byron Lathi
15b91dcc20 Add conio
Also removes print statements from the interrupt handler (except for the
button interrupt)
2022-03-14 22:20:15 -05:00
Byron Lathi
340f43103a Fix bug where A was overwritten in _uart_txb_block
If you wanted to transmit a value and then check what it was, you can do
that now.
2022-03-14 22:19:19 -05:00
Byron Lathi
8e161664bb Add uart_rxb
Once you receive a uart interrupt you can call this function to get the
received character.
2022-03-14 16:48:24 -05:00
Byron Lathi
b2344d986e Add UART interrupts
Currently an interrupt is triggered any time there is any activity on
the UART_RXD line, but later it will only trigger once there is data
ready to be read.
2022-03-14 14:57:45 -05:00
Byron Lathi
f5dbe46060 Add irq_set_status
irq_set_status can be used to clear the irq status bit so that the
interrupt will stop occuring.
2022-03-14 13:34:33 -05:00
Byron Lathi
a5474b5ae5 Implement interrupt status register
Upon an interrupt, you can read from the interrupt status register to
see what caused the interrupt.
2022-03-14 13:30:01 -05:00
Byron Lathi
e012eb7d4d Exclude vectors from list of test objects
We do not need this, since there are no interrupts during tests.
2022-03-14 13:27:29 -05:00
Byron Lathi
fe45331e7a Add interrupt handlers and redo vector locations
Most of these are taken from
https://cc65.github.io/doc/customizing.html, but modified to suit this
setup.
2022-03-14 11:54:43 -05:00
Byron Lathi
a671fda51c Add sample puts function
"Hello, world!" :)
2022-03-14 10:46:36 -05:00
Byron Lathi
da4d5f0fe7 Add uart tests 2022-03-14 00:47:26 -05:00
Byron Lathi
0b5ccf48b8 Add basic UART driver
This didn't have a chance to get tested so I hope it works.

There is not fancy stuff here, just write to the register and wait till
it is done.
2022-03-14 00:24:08 -05:00
Byron Lathi
36ff20e587 Update Makefile
Add source as comment in assembly listings.
2022-03-12 22:40:48 -06:00
Byron Lathi
d229052ed6 Add hex tests 2022-03-12 22:17:41 -06:00
Byron Lathi
a6bcadab6e Fix bugs in sevenseg.s
Fixed bug where we forgot to restore x in _hex_set_8 if the idx check
fails. We did remember to restore it if the check passed.

Fixed bug where _hex_set_24 did not return 0.
2022-03-12 22:10:37 -06:00
Byron Lathi
1a9290b97b Implement hex_set_24 2022-03-12 21:55:17 -06:00
Byron Lathi
226a2972cc Implement hex_set_16 2022-03-12 21:49:47 -06:00
Byron Lathi
c8a7cc4153 Implement enable byte in sw 2022-03-12 21:46:08 -06:00
Byron Lathi
9bbfce23e2 Add driver for hex digits
This only includes the method to set the pairs of displays individually.
The functions to write a single 16 or 32 bit value have not been
implemented yet, nor has the mask function.
2022-03-12 21:26:19 -06:00
Byron Lathi
08af30e823 Remove C tests
The previous tests are not useful anymore.
2022-03-12 19:25:01 -06:00
Byron Lathi
5106e50395 Update bootstrap code
Was missing some things like initializing the stack pointer, clearing
BSS, and things like that
2022-03-11 22:57:22 -06:00
Byron Lathi
bf28201832 Add basic hex digit code 2022-03-11 18:25:47 -06:00
Byron Lathi
58362d2ac8 Remove unused code 2022-03-11 18:24:04 -06:00
Byron Lathi
5d8c4aab44 Add USB code
Adds the usb code that we got in ECE 385. It will not work now, and
parts that involve the timer are disabled. It does compile though, with
a few warnings.

The goal will be to add USB MSD support, which is not actually given to
us so I will have to do myself or find some other code to base it off
of.
2022-03-10 16:15:08 -06:00
Byron Lathi
aca739338a Remove spi_word and replace with spi_deselect
Since the goal is to have the MAX3421E working, which uses multiple 8
bit transfers, we should support multiple 8 bit transfers instead of
trying to use 16 bit transfers.

When using spi_byte(), the device is automatically selected. After you
have made as many transfers as you want, you must deselect the device
with spi_deselect().
2022-03-10 14:43:49 -06:00
Byron Lathi
fe3851875d Add spi_word() 2022-03-10 13:38:39 -06:00
Byron Lathi
35973473d3 Change spi_write_byte to spi_byte
the SPI module reads and writes at the same time. If you don't want to
write a value, then write all zeros or whatever the device you are
communicating with wants.
2022-03-10 12:14:07 -06:00
Byron Lathi
236a75eef8 Update spi.s
Use names instead of magic values.
2022-03-10 11:29:32 -06:00
Byron Lathi
ee5271d955 Fix spi bug
Was reading a value from x, shifting it, but then not writing it back.
This caused an infinite loop as it would never move on from the MSB.
2022-03-10 11:16:35 -06:00
Byron Lathi
6f3155cf35 Add sim65 tests 2022-03-10 11:06:48 -06:00
Byron Lathi
eed7c21971 Update Makefile
Change lists to not have trailing slash

Remove listing folder during clean
2022-03-10 10:29:34 -06:00
Byron Lathi
fff193ea0f Add basic spi code
Implements the bit bang spi protocol
2022-03-10 10:26:36 -06:00
Byron Lathi
80d49b4f87 Update makefile
Generates listing files and a map file now.
2022-03-10 10:25:36 -06:00