Commit Graph

45 Commits

Author SHA1 Message Date
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
Byron Lathi
3f5a653326 Rename assembly files from .S to .s 2022-03-10 10:17:37 -06:00
Byron Lathi
bac37bab55 Remove non existing import 2022-03-08 15:50:10 -06:00
Byron Lathi
2c26e82a0d Remove io c code 2022-03-08 15:41:03 -06:00
Byron Lathi
f1f1a90eeb Change IO_REMAP location 2022-03-05 23:23:05 -06:00
Byron Lathi
e9104e4233 Add explicit assembly targets 2022-03-05 22:34:54 -06:00
Byron Lathi
6b24abdbd5 Add io helper functions 2022-03-05 22:34:34 -06:00
Byron Lathi
859a954996 Add STARTUP info 2022-03-05 21:26:09 -06:00
Byron Lathi
048db615b9 Add basic io header 2022-03-05 21:17:33 -06:00
Byron Lathi
9c29aa4fdf Update linker script to allow c source files 2022-03-05 21:09:46 -06:00
Byron Lathi
37e122197f Refactor CI into one file
Remove the downstream stuff and consolidate the hw and sw pipelines into
one.
2022-03-05 19:22:00 -06:00
Byron Lathi
dbf990df3b Add ci 2022-03-05 18:57:19 -06:00
Byron Lathi
a2fdcc5553 Add software files 2022-03-05 18:48:19 -06:00