Skip to content

Instantly share code, notes, and snippets.

View vintagechips's full-sized avatar

vintagechips vintagechips

View GitHub Profile
@vintagechips
vintagechips / pic_oled.c
Last active January 27, 2022 02:29
PIC16F18313 SSD1306 OLED test program xc8 source
// CONFIG1
#pragma config FEXTOSC = OFF // FEXTOSC External Oscillator mode Selection bits (Oscillator not enabled)
#pragma config RSTOSC = HFINT32 // Power-up default value for COSC bits (HFINTOSC with 2x PLL (32MHz))
#pragma config CLKOUTEN = OFF // Clock Out Enable bit (CLKOUT function is disabled; I/O or oscillator function on OSC2)
#pragma config CSWEN = ON // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed)
#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is enabled)
// CONFIG2
#pragma config MCLRE = ON // Master Clear Enable bit (MCLR/VPP pin function is MCLR; Weak pull-up enabled )
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
@vintagechips
vintagechips / p18f47q43_hello.c
Last active January 13, 2022 05:52
PIC18F47Q43 UART3 hello, world and echoback test
// PIC18F47Q43 Configuration Bit Settings
// 'C' source line config statements
// CONFIG1
#pragma config FEXTOSC = ECH // External Oscillator Selection (EC (external clock) above 8 MHz)
#pragma config RSTOSC = HFINTOSC_64MHZ// Reset Oscillator Selection (HFINTOSC with HFFRQ = 64 MHz and CDIV = 1:1)
// CONFIG2
#pragma config CLKOUTEN = OFF // Clock out Enable bit (CLKOUT function is disabled)
#pragma config PPS1WAY = OFF // PPSLOCK bit One-Way Set Enable bit (PPSLOCKED bit can be set and cleared repeatedly (subject to the unlock sequence))
@vintagechips
vintagechips / blink68k.asm
Created June 20, 2021 06:12
Blink LED program for DIGIT TMP68301 board
* Title: Blink LED
* Target: DIGIT TMP68301 BOARD
* Assembler: https://archive.org/details/68000ASM_ZIP
* Helper: http://takeda-toshiya.my.coocan.jp/msdos/
* Win32 command: msdos asm -l blink68k.asm
*
* Special thanks @comoneko on Twitter
*
IORBASE equ $00FFFC00
*
@vintagechips
vintagechips / UMON85.asm
Created April 14, 2021 08:19
Micro monitor for MCS8085 with assembler/disassembler.
; uMON85 SBC8085 MICRO MONITOR
;
; DEFAULT VALUE
LINSIZ EQU 26 ; SIZE OF LINE BUFFER
TXIM EQU 040H ; SIM INITIAL VALUE
;
; RESET VECTOR
ORG 0000H
RESET: LXI SP,STKBTM ; STACK SETUP
JMP MAIN ; GO MAIN
@vintagechips
vintagechips / UMON85.asm
Last active April 3, 2021 05:40
Micro monitor for SBC8080/8085 with assembler/disassembler.
; uMON85 SBC8085 MICRO MONITOR
;
; DEFAULT VALUE
LINSIZ EQU 26 ; SIZE OF LINE BUFFER
;
; RESET VECTOR
ORG 0000H
RESET: LXI SP,LBUF ; スタック設定
JMP MAIN ; MAINから開始
;
@vintagechips
vintagechips / VEMHELLO.ASM
Last active July 14, 2022 21:12
HELLO, WOLD that runs in NEC V20 Emulation mode
; SBCV20 terminal test program
; Assembler: asm86.com/asm86.cmd
;
MEM equ 0000h ;Memory top
ROM equ 8000h ;Rom top
STACK equ 8000h ;Stack top
REGAD equ 00h ;8251 data register
REGAC equ 01h ;8251 control register
RTSHIG equ 17h ;RTS high
RTSLOW equ 37h ;RTS low
@vintagechips
vintagechips / f8hello.asm
Created November 3, 2020 05:04
SBCF8 hello, world
; SBCF8 hello, world
; dasm f8blink.asm -f3 -of8blink.bin -Lf8blink.lst
UARTD EQU $FF00
UARTC EQU $FF01
PROCESSOR F8
ORG $0000
JMP START
;
; MESSAGE
@vintagechips
vintagechips / DRKILLER.ASM
Last active August 14, 2020 23:53
DRAM KILLER for SBCZ80
; DRAM KILLER
; TARGET: SBCZ80
; ASSEMBLER: ARCPIT XZ80.EXE
;
ROMTOP EQU 0000H ;ROM領域の先頭
RAMTOP EQU 8000H ;RAM領域の先頭
SSTACK EQU 8010H ;スタックトップ
;
PSIOAD EQU 00H ;SIOチャンネルAのデータレジスタ
PSIOAC EQU 01H ;SIOチャンネルAの制御レジスタ
@vintagechips
vintagechips / PIC16F18313_main.c
Last active August 7, 2020 07:52
SBC6800 SysClock, BaudRate, and Reset Generator 2MHz version by masa
/*
SBC6800 cock/boud rate/reset generator
Device: PIC16F18313
Compiler: XC8
*/
/* PIC16F18313
* +--x--+
* +5V VDD|1 8|VSS GND
* RST(O) RA5|2 7|RA0 RST(I)
#include <WiFi.h>
const char* ssid = "Buffalo-G-0E94";
const char* password = "password";
const int port = 23;
WiFiServer server(port);
void setup() {
Serial.begin(9600);