This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;SFR - STC89C52RC | |
XICON EQU 0xC0 | |
T2CON EQU 0xC8 | |
T2MOD EQU 0xC9 | |
RCAP2L EQU 0xCA | |
RCAP2H EQU 0xCB | |
TL2 EQU 0xCC | |
TH2 EQU 0xCD | |
WDT_CONTR EQU 0xE1 | |
ISP_DATA EQU 0xE2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FUNC_SPI: | |
; SPI Function (Start - Send cmd - Exchange data - end) | |
; MSB send first | |
; Input: A: Send cmd; B: Send data; | |
; Return: A: Get data; | |
MISO EQU P3.4 | |
MOSI EQU P3.5 | |
SCLK EQU P3.6 | |
SS EQU P3.7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FUNC_UART_SEND_RAW: | |
; UART Function, send the value stored in ACC, in raw binary format | |
; Input: ACC: The value | |
; Output: void | |
MOV SBUF, A | |
JMP $ | |
RET | |
;It is recommanded to write this block in the parent function, instead of call this function | |
FUNC_UART_SEND_STRING: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--8-bit ALU unit | |
--Include libearies | |
library ieee; | |
use ieee.std_logic_1164.all; | |
use ieee.std_logic_unsigned.all; | |
--Block IO | |
entity alu is | |
port( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--2 4-bit divider | |
--Include libearies | |
library ieee; | |
use ieee.std_logic_1164.all; | |
use ieee.std_logic_unsigned.all; | |
--Block IO | |
entity divider is | |
port( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
#include <LiquidCrystal.h> | |
#include <stdint.h> | |
#define LED 9 | |
#define PUSH 8 | |
#define TIMEOUT 10000 | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
#include <stdint.h> | |
#include <IRremote.h> | |
#include <LiquidCrystal.h> | |
#define TIMEOUT 120 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
How to use: | |
1. Login to your uWinSite | |
2. Go to: Manage Classes/View my Classes | |
3. Choose the semester, and you should see all your classes in the page. | |
4. Open the page inspector of your web browser. | |
5. Copy the code into the debugger and hit enter. The code is now embedded into the page. | |
6. Execute "timetable()" in the debuger. | |
7. The timetable will be generated, and it will be located at the bottom of the page. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Scratch, save before call child, free to use in subroutine | |
#define _RA R0 | |
;Always zero, do not modify | |
#define _RZERO R1 | |
;Temp register, save before call child, free to use in subroutine | |
#define _RT0 R18 ;Arg3 | |
#define _RT1 R19 | |
#define _RT2 R20 ;Arg2 |
OlderNewer