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
#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
--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
--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
; |
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
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
;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 |
NewerOlder