Skip to content

Instantly share code, notes, and snippets.

@ryu10
ryu10 / sim.sh
Created April 28, 2024 04:13
Icarus Verilog sim execution script for oneshottmr.v
TOP_MODULE=oneshottmr_sim
OUT_FILE=test.out
# compile
iverilog -g2012 \
-o ${OUT_FILE} \
-s ${TOP_MODULE} ./scenario.sv ../src/oneshottmr.v
# ./oneshottmr_orig.v
# ../src/oneshottmr.v
@ryu10
ryu10 / scenario.sv
Created April 28, 2024 04:12
Icarus Verilog scenario file for oneshottmr.v
//////////////////////////////////////////////////////////////
// module :oneshottmr_sim
/////////////////////////////////////////////////////////////
`timescale 1ns/1ps
module oneshottmr_sim;
// Create clock
parameter CLK_E_1MHz = 1000; // ns
@ryu10
ryu10 / oneshottmr.v
Created April 28, 2024 03:28
Assist09 PTM one-shot timer
// Verilog one-shot counter module
module oneshottmr
(
input clk,
input reset_n,
input trigger,
output reg q_n
);
@ryu10
ryu10 / leap-keyboard-layout-r2.json
Last active January 30, 2024 06:04
Leap Keyboard layout
[
[
{
"t": "#000000\n\n#0a0000"
},
"o\n+/-\nPara\nSS\nL MGN",
{
"t": "#000000",
"a": 5
},
{
Online Pascal Compiler.Code, Compile,
Run and Debug Pascal program online.Write your code in this editor and
press "Run" button to execute it.}
program asciiart;
var
x, y, i, i2, flag:integer;
@ryu10
ryu10 / h2b.patch
Last active May 24, 2023 15:51
hex2bin patch on libcrc.h Makefile common.h
--- hex2bin/libcrc.h 2023-05-21 01:35:20.711215991 +0100
+++ hex2bin.new/libcrc.h 2023-05-21 01:21:23.359661817 +0100
@@ -24,7 +24,7 @@
#ifndef _LIBCRC_H_
#define _LIBCRC_H_
-void *crc_table;
+extern void *crc_table;
void init_crc8_normal_tab(uint8_t polynom);
@ryu10
ryu10 / caint.s
Last active November 20, 2022 17:56
MC6821 PIA CA1 Interrupt test program
***
* PIA - CA1 Interrupt
*
* RyuStudio Nov. 2022
***
*
* Lambda-2022 PIA Adrs
p0da equ $f008 ; PIA0 DA
p0ca equ p0da+1 ; PIA0 CA
p0db equ p0da+2 ; PIA0 DB
@ryu10
ryu10 / blinkall.s
Last active November 19, 2022 18:53
MC6821 PIA test programs for Lambda-2022 computer
***
* PIA - Blink All ports
*
* RyuStudio Nov. 2022
***
*
* Lambda-2022 PIA Adrs
p0da equ $f008 ; PIA0 DA
p0ca equ p0da+1 ; PIA0 CA
p0db equ p0da+2 ; PIA0 DB
@ryu10
ryu10 / tasks.json
Last active November 9, 2022 04:07
tasks.json for code-cupl with variable file argument
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
@ryu10
ryu10 / DM9368N-HexLED.ino
Last active September 2, 2022 16:55
I got ten units of DM9368N from eBay. Test them before use.
void displayHex(unsigned int d0){
(d0 & 0x0001)?digitalWrite(2, HIGH):digitalWrite(2, LOW);
(d0 & 0x0002)?digitalWrite(3, HIGH):digitalWrite(3, LOW);
(d0 & 0x0004)?digitalWrite(4, HIGH):digitalWrite(4, LOW);
(d0 & 0x0008)?digitalWrite(5, HIGH):digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(6, HIGH); // data latched
}
unsigned int data=0;