Wireless nRF24L01+ bootloader added!

No more Padauk PMS171b!
This commit is contained in:
Anders Nielsen 2022-04-03 14:13:47 +02:00
parent a0bde32e1f
commit b4973d05d2
43 changed files with 185236 additions and 28272 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,82 +0,0 @@
#include "extern.h"
// P#, VDD, PA0, PA3, PA4, PA5, PA6, PA7, GND, MASK1, MASK2, SHIF#
.writer package 16, 5, 11, 9, 10, 8, 7, 6, 12, 0x00, 0x00, 0
VSYNC BIT PA.4;
//HSYNC BIT PA.4;
//HBLANK BIT PA.6;
VBLANK BIT PA.7;
A13 BIT PA.3
byte mode = 0;
word line = 0;
word count = 0;
void FPPA0 (void)
{
// .ADJUST_IC SYSCLK=IHRC/2, IHRC=15734375Hz, Vdd=5.0V // SYSCLK=IHRC/2
.ADJUST_IC SYSCLK=IHRC/2, IHRC=16000KHz, Vdd=5.0V // SYSCLK=IHRC/2
// clkmd.En_Reset = 0; // PA.5 as Reset pin
CLKMD = 0x35;
// Insert Initial Code
paph.5 = 1; //Does this work?
$ VSYNC HIGH, OUT;
$ VBLANK HIGH, OUT;
$ A13 LOW, OUT;
PBC = 0xFF;
PB = 0;
line = 0;
$ INTEN PA0;
INTEGS = 0b0;
INTRQ = 0;
ENGINT;
while (1)
{
if (line.8 == 1){
A13 = 1;
} else
{
A13 = 0;
}
if (line == 490) {
$ VSYNC LOW;
}
if (line == 492) {
$ VSYNC HIGH;
}
if (line == 524) {
line = 0;
}
} //While 1
} //FPPA0
void Interrupt (void)
{
pushaf; //We don't care about flags - only timing... Or maybe we do?
if (Intrq.PA0)
{
line++;
PB = line;
Intrq.PA0 = 0;
}
popaf;
}

Binary file not shown.

View File

@ -1,25 +0,0 @@
.CHIP PMS171B
//{{PADAUK_CODE_OPTION
.Code_Option LVR 3.0V
.Code_Option Comparator_Edge All_Edge
.Code_Option GPC_PWM Disable
.Code_Option TM2_Out1 PB2
.Code_Option TMx_Bit 7BIT
.Code_Option TMx_Source 16MHz
.Code_Option Interrupt_Src1 PB.0
.Code_Option Interrupt_Src0 PA.0
.Code_Option Bootup_Time Fast
.Code_Option PB4_PB5_Drive Strong
.Code_Option Security Enable // Security 7/8 words Enable
//}}PADAUK_CODE_OPTION
// ----------- IMPORTANT -------------
// Please don't change the follow code
// It only be used for internal Mini-C
// -----------------------------------
.JMP FPPA0 <?>, 0
.ROMADR 0x10
.PUT Interrupt <reti>, 8

View File

@ -1,29 +0,0 @@
[INI]
PROJECT=PRE_FILE
[LINKS]
~PMS171-VGA.C
[HEAD]
~extern.h
[DEPEND]
~$:INC_PDK\PMS171B.INC
~PMS171-VGA.PRE
[Ram_Break]
Break1=No 0000
Break2=No 0000
Break3=No 0000
Break4=No 0000
[Stack_Break]
Break1=Au 0000 00FF
Break2=Au 0000 00FF
Break3=Au 0000 00FF
Break4=Au 0000 00FF
Break5=Au 0000 00FF
Break6=Au 0000 00FF
Break7=Au 0000 00FF
Break8=Au 0000 00FF
[Ctrl_Break]
Mark=51 1
ICE=0 6 2 1388
[PRE]
~PMS171-VGA.PRJ
~PMS171-VGA.PRE

View File

@ -1,16 +0,0 @@
System_Clock EQU 15734375/2 // Used at UART, PS2, ...
/* // A example for use ADCRH & ADCR
#if defined(ADCC)
#if defined(ADCR)
ADCRH EQU ADCR
ADCRL EQU 0
#else
ADCR EQU ADCRH
#endif
#endif
*/

View File

@ -1,18 +1,23 @@
ABNielsen.com 6502 Single Board Computer
ABNielsen.com 6502 Single Board Computer R1
This is a 6502-based complete single board computer intended to help during the global IC shortage. Why use new chips when you can reuse scrap?
Check out the project on HackADay if you want to read more and see some pretty pictures :)
Check out the (old) project on HackADay if you want to read more and see some pretty pictures :)
https://hackaday.io/project/181897-abnielsencom-6502-sbc
R1 will get its own separate project on HackADay - in celebration that I got rid of the Padauk MCU without increasing the chip count!
Build instructions:
1) Send gerber files from /hardware to your favorite board house
2) Build the project using assemble.sh - this will also try to burn the main ROM using Minipro. Dependencies: [CC65] (https://github.com/cc65/cc65), the Padauk IDE (working on replacing the PMS171b with 7400 logic) and a way to burn the ROM's.
3) Burn the ROMs and PMS171B. I use a TL866II Plus variant for the actual ROMs and the Padauk official programmer for the PMS171B.
4) Source the IC's - the spirit of this project is to contribute as little as possible to the global IC shortage and get used chips from Ebay/AliExpress/etc.
2) Build the project using assemble.sh - this will also try to burn the main ROM using Minipro. Dependencies: [CC65] (https://github.com/cc65/cc65) and a way to burn the ROM's.
3) Burn the ROMs. I use a TL866II Plus variant for the actual ROMs.
4) Source the IC's - the spirit of this project is to contribute as little as possible to the global IC shortage and get used chips locally or from Ebay/AliExpress/etc.
5) Solder away
6) For the PS/2-keyboard I use Ben Eater's interface on a breadboard: https://www.reddit.com/r/beneater/comments/mjeilv/keyboard_interface_diagram/
6) For the PS/2-keyboard I use Ben Eater's (a.k.a. Dieter Müller's) interface: https://www.reddit.com/r/beneater/comments/mjeilv/keyboard_interface_diagram/
7) Enjoy!
Optional:
Setup SSH keys with a Raspberry Pi, connect an nRF24L01+ compatible module to it and compile the wireless bootloader code in /software_linux
License: Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) https://creativecommons.org/licenses/by-nc/4.0/

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,9 @@
#!/bin/bash
ca65 --cpu 6502 -l build/listing.txt -o build/abn6502rom.o abn6502rom.s
ca65 -vvv --cpu 6502 -l build/listing.txt -o build/abn6502rom.o abn6502rom.s
ca65 crom.s -o build/crom.o
ld65 -o build/abn6502rom.bin -C memmap.cfg "./build/abn6502rom.o" "./build/crom.o"
ca65 userland.s --cpu 65c02 -l build/userlisting.txt -o build/userland.o
ld65 -o build/abn6502rom.bin -C memmap.cfg "./build/abn6502rom.o" "./build/crom.o" "./build/userland.o"
minipro -s -p "SST39SF010A" -w build/abn6502rom.bin
#minipro -s -p "W27C512@DIP28" -w build/abn6502rom.bin
scp build/userland.bin openhabian@openhabiandevice.local:./
ssh openhabian@openhabiandevice.local bootload -s userland.bin

BIN
build/abn6502rom.bin Normal file

Binary file not shown.

BIN
build/abn6502rom.o Normal file

Binary file not shown.

BIN
build/crom.bin Normal file

Binary file not shown.

BIN
build/crom.o Normal file

Binary file not shown.

1535
build/listing.txt Normal file

File diff suppressed because it is too large Load Diff

BIN
build/userland.bin Normal file

Binary file not shown.

BIN
build/userland.o Normal file

Binary file not shown.

33
build/userlisting.txt Normal file
View File

@ -0,0 +1,33 @@
ca65 V2.19 - Git c3d7a9008
Main file : userland.s
Current file: userland.s
000000r 1
000000r 1 PRIMM = $FFC8 ; Userland can use ROM subroutines if we tell them where they are. Check listing.txt for current subroutine addresses
000000r 1 .feature string_escapes ; Allow c-style string escapes when using ca65
000000r 1
000000r 1 .segment "USERLAND"
000000r 1 userland:
000000r 1 20 C8 FF jsr PRIMM
000003r 1 54 65 73 74 .asciiz "Testing CPU...\n"
000007r 1 69 6E 67 20
00000Br 1 43 50 55 2E
000013r 1 cOhtwotest:
000013r 1 80 1D bra see02
000015r 1 20 C8 FF jsr PRIMM
000018r 1 48 69 21 20 .asciiz "Hi! Im an NMOS 6502! \n"
00001Cr 1 49 6D 20 61
000020r 1 6E 20 4E 4D
00002Fr 1 4C rr rr jmp exitnow
000032r 1 see02:
000032r 1 20 C8 FF jsr PRIMM
000035r 1 48 69 21 20 .asciiz "Hi! Im a CMOS 65C02! \n"
000039r 1 49 6D 20 61
00003Dr 1 20 43 4D 4F
00004Cr 1 exitnow:
00004Cr 1 20 C8 FF jsr PRIMM
00004Fr 1 50 72 6F 67 .asciiz "Program finished. Returning to main.\n"
000053r 1 72 61 6D 20
000057r 1 66 69 6E 69
000075r 1 00 brk
000075r 1

View File

@ -1 +1,2 @@
#!/bin/bash
minipro -s -p "W27C512@DIP28" -w build/crom.bin

BIN
hardware/.DS_Store vendored

Binary file not shown.

View File

@ -252,6 +252,54 @@ X GND 7 0 -500 200 U 50 50 7 0 W
ENDDRAW
ENDDEF
#
# 74xx_74HC14
#
DEF 74xx_74HC14 U 0 40 Y Y 7 L N
F0 "U" 0 50 50 H V C CNN
F1 "74xx_74HC14" 0 -50 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
ALIAS 74LS14
$FPLIST
DIP*W7.62mm*
$ENDFPLIST
DRAW
S -200 300 200 -300 7 1 10 f
P 4 1 0 10 -150 150 -150 -150 150 0 -150 150 f
P 4 2 0 10 -150 150 -150 -150 150 0 -150 150 f
P 4 3 0 10 -150 150 -150 -150 150 0 -150 150 f
P 4 4 0 10 -150 150 -150 -150 150 0 -150 150 f
P 4 5 0 10 -150 150 -150 -150 150 0 -150 150 f
P 4 6 0 10 -150 150 -150 -150 150 0 -150 150 f
P 3 1 1 0 -75 -50 -75 50 -25 50 N
P 4 1 1 0 -100 -50 -25 -50 -25 50 0 50 N
P 3 2 1 0 -75 -50 -75 50 -25 50 N
P 4 2 1 0 -100 -50 -25 -50 -25 50 0 50 N
P 3 3 1 0 -75 -50 -75 50 -25 50 N
P 4 3 1 0 -100 -50 -25 -50 -25 50 0 50 N
P 3 4 1 0 -75 -50 -75 50 -25 50 N
P 4 4 1 0 -100 -50 -25 -50 -25 50 0 50 N
P 3 5 1 0 -75 -50 -75 50 -25 50 N
P 4 5 1 0 -100 -50 -25 -50 -25 50 0 50 N
P 3 6 1 0 -75 -50 -75 50 -25 50 N
P 4 6 1 0 -100 -50 -25 -50 -25 50 0 50 N
X ~ 1 -300 0 150 R 50 50 1 0 I
X ~ 2 300 0 150 L 50 50 1 0 O I
X ~ 3 -300 0 150 R 50 50 2 0 I
X ~ 4 300 0 150 L 50 50 2 0 O I
X ~ 5 -300 0 150 R 50 50 3 0 I
X ~ 6 300 0 150 L 50 50 3 0 O I
X ~ 8 300 0 150 L 50 50 4 0 O I
X ~ 9 -300 0 150 R 50 50 4 0 I
X ~ 10 300 0 150 L 50 50 5 0 O I
X ~ 11 -300 0 150 R 50 50 5 0 I
X ~ 12 300 0 150 L 50 50 6 0 O I
X ~ 13 -300 0 150 R 50 50 6 0 I
X VCC 14 0 500 200 D 50 50 7 0 W
X GND 7 0 -500 200 U 50 50 7 0 W
ENDDRAW
ENDDEF
#
# 74xx_74HC245
#
DEF 74xx_74HC245 U 0 40 Y Y 1 L N
@ -328,6 +376,42 @@ X Q3 9 500 200 200 L 50 50 1 0 O
ENDDRAW
ENDDEF
#
# 74xx_74HC590
#
DEF 74xx_74HC590 U 0 20 Y Y 1 F N
F0 "U" -300 650 50 H V C CNN
F1 "74xx_74HC590" -300 -550 50 H V C CNN
F2 "" 0 50 50 H I C CNN
F3 "" 0 50 50 H I C CNN
ALIAS 74LS590 74HC590A
$FPLIST
DIP*W7.62mm*
SOIC*3.9x9.9mm*P1.27mm*
TSSOP*4.4x5mm*P0.65mm*
SOIC*5.3x10.2mm*P1.27mm*
SOIC*7.5x10.3mm*P1.27mm*
$ENDFPLIST
DRAW
S -300 600 300 -500 1 1 10 f
X Q1 1 400 400 100 L 50 50 1 0 T
X ~MRC 10 -400 0 100 R 50 50 1 0 I
X CPC 11 -400 300 100 R 50 50 1 0 I
X ~CE 12 -400 500 100 R 50 50 1 0 I
X CPR 13 -400 200 100 R 50 50 1 0 I
X ~OE 14 -400 -200 100 R 50 50 1 0 I
X Q0 15 400 500 100 L 50 50 1 0 T
X VCC 16 0 700 100 D 50 50 1 0 W
X Q2 2 400 300 100 L 50 50 1 0 T
X Q3 3 400 200 100 L 50 50 1 0 T
X Q4 4 400 100 100 L 50 50 1 0 T
X Q5 5 400 0 100 L 50 50 1 0 T
X Q6 6 400 -100 100 L 50 50 1 0 T
X Q7 7 400 -200 100 L 50 50 1 0 T
X GND 8 0 -600 100 U 50 50 1 0 W
X ~RCO 9 400 -400 100 L 50 50 1 0 O
ENDDRAW
ENDDEF
#
# 74xx_74LS00
#
DEF 74xx_74LS00 U 0 40 Y Y 5 L N
@ -403,6 +487,39 @@ X ~ 13 -300 -100 170 R 50 50 4 2 I I
ENDDRAW
ENDDEF
#
# 74xx_74LS109
#
DEF 74xx_74LS109 U 0 40 Y Y 3 L N
F0 "U" -300 350 50 H V C CNN
F1 "74xx_74LS109" -300 -350 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
DIP*W7.62mm*
$ENDFPLIST
DRAW
S -200 200 200 -200 1 1 10 f
S -200 200 200 -200 2 1 10 f
S -200 300 200 -300 3 1 10 f
X ~R 1 0 -300 100 U 50 50 1 0 I
X J 2 -300 100 100 R 50 50 1 0 I
X ~K 3 -300 -100 100 R 50 50 1 0 I
X C 4 -300 0 100 R 50 50 1 0 I C
X ~S 5 0 300 100 D 50 50 1 0 I
X Q 6 300 100 100 L 50 50 1 0 O
X ~Q 7 300 -100 100 L 50 50 1 0 O
X Q 10 300 100 100 L 50 50 2 0 O
X ~S 11 0 300 100 D 50 50 2 0 I
X C 12 -300 0 100 R 50 50 2 0 I C
X ~K 13 -300 -100 100 R 50 50 2 0 I
X J 14 -300 100 100 R 50 50 2 0 I
X ~R 15 0 -300 100 U 50 50 2 0 I
X ~Q 9 300 -100 100 L 50 50 2 0 O
X VCC 16 0 400 100 D 50 50 3 0 W
X GND 8 0 -400 100 U 50 50 3 0 W
ENDDRAW
ENDDEF
#
# 74xx_74LS161
#
DEF 74xx_74LS161 U 0 40 Y Y 1 L N
@ -846,6 +963,37 @@ X ~ 9 -300 -100 200 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Connector_Generic_Conn_02x04_Odd_Even
#
DEF Connector_Generic_Conn_02x04_Odd_Even J 0 40 Y N 1 F N
F0 "J" 50 200 50 H V C CNN
F1 "Connector_Generic_Conn_02x04_Odd_Even" 50 -300 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_2x??_*
$ENDFPLIST
DRAW
S -50 -195 0 -205 1 1 6 N
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 105 0 95 1 1 6 N
S -50 150 150 -250 1 1 10 f
S 150 -195 100 -205 1 1 6 N
S 150 -95 100 -105 1 1 6 N
S 150 5 100 -5 1 1 6 N
S 150 105 100 95 1 1 6 N
X Pin_1 1 -200 100 150 R 50 50 1 1 P
X Pin_2 2 300 100 150 L 50 50 1 1 P
X Pin_3 3 -200 0 150 R 50 50 1 1 P
X Pin_4 4 300 0 150 L 50 50 1 1 P
X Pin_5 5 -200 -100 150 R 50 50 1 1 P
X Pin_6 6 300 -100 150 L 50 50 1 1 P
X Pin_7 7 -200 -200 150 R 50 50 1 1 P
X Pin_8 8 300 -200 150 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Device_C
#
DEF Device_C C 0 10 N Y 1 F N
@ -1110,8 +1258,8 @@ F2 "" 0 300 50 H I C CNN
F3 "" 0 300 50 H I C CNN
DRAW
S -400 1250 400 -1150 0 1 10 f
X GND 16 0 -1200 50 U 50 50 0 0 W N
X VCC 32 0 1300 50 D 50 50 0 0 W N
X GND 16 0 -1200 50 U 50 50 0 0 W
X VCC 32 0 1300 50 D 50 50 0 0 W
X NC 1 -600 -600 200 R 50 50 1 1 I
X A2 10 -600 1000 200 R 50 50 1 1 I
X A1 11 -600 1100 200 R 50 50 1 1 I
@ -1189,34 +1337,6 @@ X A1 9 -500 600 150 R 50 50 1 1 I
ENDDRAW
ENDDEF
#
# Padauk_IC_PMS171B-SOP16_150mil
#
DEF Padauk_IC_PMS171B-SOP16_150mil U 0 40 Y Y 1 F N
F0 "U" 0 -200 50 H V C CNN
F1 "Padauk_IC_PMS171B-SOP16_150mil" 0 -300 50 H V C CNN
F2 "" 0 200 50 H I C CNN
F3 "" 0 200 50 H I C CNN
DRAW
S -1050 -350 1100 -1450 0 1 0 f
X PB4/AD4/TM2PWM 1 -1150 -550 100 R 50 50 1 1 B
X PA4/AD9/CIN+/CIN1-/INT1A 10 1200 -1150 100 L 50 50 1 1 B
X PA0/AD10/CO/INT0 11 1200 -1050 100 L 50 50 1 1 B
X GND 12 1200 -950 100 L 50 50 1 1 W
X PB0/TM2PWM/INT1 13 1200 -850 100 L 50 50 1 1 B
X PB1/AD1/Vref 14 1200 -750 100 L 50 50 1 1 B
X PB2/AD2/TM2PWM 15 1200 -650 100 L 50 50 1 1 B
X PB3/AD3 16 1200 -550 100 L 50 50 1 1 B
X PB5/AD5/TM3PWM/INT0A 2 -1150 -650 100 R 50 50 1 1 B
X PB6/AD6/CIN4-/TM3PWM 3 -1150 -750 100 R 50 50 1 1 B
X PB7/AD7/CIN5-/TM3PWM 4 -1150 -850 100 R 50 50 1 1 B
X VDD 5 -1150 -950 100 R 50 50 1 1 W
X PA7/X1 6 -1150 -1050 100 R 50 50 1 1 B
X PA6/X2 7 -1150 -1150 100 R 50 50 1 1 B
X PA5/PRSTB 8 -1150 -1250 100 R 50 50 1 1 B
X PA3/AD8/CIN0-/TM2PWM 9 1200 -1250 100 L 50 50 1 1 B
ENDDRAW
ENDDEF
#
# Regulator_Linear_MIC5504-3.3YM5
#
DEF Regulator_Linear_MIC5504-3.3YM5 U 0 20 Y Y 1 F N

View File

@ -1,6 +1,34 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# PMS171B-SOP16_150mil-Padauk_IC
#
DEF PMS171B-SOP16_150mil-Padauk_IC U 0 40 Y Y 1 F N
F0 "U" 0 -200 50 H V C CNN
F1 "PMS171B-SOP16_150mil-Padauk_IC" 0 -300 50 H V C CNN
F2 "" 0 200 50 H I C CNN
F3 "" 0 200 50 H I C CNN
DRAW
S -1050 -350 1100 -1450 0 1 0 f
X PB4/AD4/TM2PWM 1 -1150 -550 100 R 50 50 1 1 B
X PA4/AD9/CIN+/CIN1-/INT1A 10 1200 -1150 100 L 50 50 1 1 B
X PA0/AD10/CO/INT0 11 1200 -1050 100 L 50 50 1 1 B
X GND 12 1200 -950 100 L 50 50 1 1 W
X PB0/TM2PWM/INT1 13 1200 -850 100 L 50 50 1 1 B
X PB1/AD1/Vref 14 1200 -750 100 L 50 50 1 1 B
X PB2/AD2/TM2PWM 15 1200 -650 100 L 50 50 1 1 B
X PB3/AD3 16 1200 -550 100 L 50 50 1 1 B
X PB5/AD5/TM3PWM/INT0A 2 -1150 -650 100 R 50 50 1 1 B
X PB6/AD6/CIN4-/TM3PWM 3 -1150 -750 100 R 50 50 1 1 B
X PB7/AD7/CIN5-/TM3PWM 4 -1150 -850 100 R 50 50 1 1 B
X VDD 5 -1150 -950 100 R 50 50 1 1 W
X PA7/X1 6 -1150 -1050 100 R 50 50 1 1 B
X PA6/X2 7 -1150 -1150 100 R 50 50 1 1 B
X PA5/PRSTB 8 -1150 -1250 100 R 50 50 1 1 B
X PA3/AD8/CIN0-/TM2PWM 9 1200 -1250 100 L 50 50 1 1 B
ENDDRAW
ENDDEF
#
# R6502-65xx
#
DEF R6502-65xx U 0 40 Y Y 1 F N

File diff suppressed because it is too large Load Diff

19728
hardware/6502.kicad_pcb-bak Normal file → Executable file

File diff suppressed because it is too large Load Diff

75
hardware/6502.kicad_prl Normal file
View File

@ -0,0 +1,75 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "All Layers",
"auto_track_width": false,
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"ratsnest_display_mode": 0,
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": true,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"meta": {
"filename": "6502.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

469
hardware/6502.kicad_pro Normal file
View File

@ -0,0 +1,469 @@
{
"board": {
"design_settings": {
"defaults": {
"board_outline_line_width": 0.049999999999999996,
"copper_line_width": 0.19999999999999998,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.049999999999999996,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.09999999999999999,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.09999999999999999,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 1.0,
"height": 1.7,
"width": 1.7
},
"silk_line_width": 0.12,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"45_degree_only": false,
"min_clearance": 0.508
}
},
"diff_pair_dimensions": [
{
"gap": 0.0,
"via_gap": 0.0,
"width": 0.0
}
],
"drc_exclusions": [
"courtyards_overlap|155728446|159269999|00000000-0000-0000-0000-000061f522ee|f2480d0c-9b08-4037-9175-b2369af04d4c",
"courtyards_overlap|15766501|124111001|00000000-0000-0000-0000-000060e50bd2|6e105729-aba0-497c-a99e-c32d2b3ddb6d",
"courtyards_overlap|20219999|115675001|00000000-0000-0000-0000-000061f52280|00000000-0000-0000-0000-000061f52296",
"courtyards_overlap|20219999|118215001|00000000-0000-0000-0000-000061f52280|00000000-0000-0000-0000-000061f52a3b",
"courtyards_overlap|20219999|120755001|00000000-0000-0000-0000-000061f52a3b|6e105729-aba0-497c-a99e-c32d2b3ddb6d",
"courtyards_overlap|61700001|163300001|00000000-0000-0000-0000-000060df7d6f|00000000-0000-0000-0000-000060dfdf36",
"malformed_courtyard|19425000|147670000|4412226e-d975-40a2-921f-502ff4129a95|00000000-0000-0000-0000-000000000000",
"track_dangling|15621000|142367000|7bfa1704-7a78-4569-b948-61602dfd30d6|00000000-0000-0000-0000-000000000000"
],
"meta": {
"filename": "board_design_settings.json",
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"copper_edge_clearance": "error",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint_type_mismatch": "error",
"hole_clearance": "error",
"hole_near_hole": "error",
"invalid_outline": "error",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "error",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zone_has_empty_net": "error",
"zones_intersect": "error"
},
"rule_severitieslegacy_courtyards_overlap": true,
"rule_severitieslegacy_no_courtyard_defined": false,
"rules": {
"allow_blind_buried_vias": false,
"allow_microvias": false,
"max_error": 0.005,
"min_clearance": 0.0,
"min_copper_edge_clearance": 0.049999999999999996,
"min_hole_clearance": 0.25,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.19999999999999998,
"min_microvia_drill": 0.09999999999999999,
"min_silk_clearance": 0.0,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.13,
"min_via_annular_width": 0.049999999999999996,
"min_via_diameter": 0.6,
"use_height_for_length_calcs": true
},
"track_widths": [
0.0
],
"via_dimensions": [
{
"diameter": 0.0,
"drill": 0.0
}
],
"zones_allow_external_fillets": false,
"zones_use_no_outline": true
},
"layer_presets": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_label_syntax": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "error",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "6502.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12.0,
"clearance": 0.13,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.13,
"via_diameter": 0.6,
"via_drill": 0.3,
"wire_width": 6.0
},
{
"bus_width": 12.0,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Power",
"nets": [
"+3V3",
"+5V",
"GND"
],
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.25,
"via_diameter": 0.6,
"via_drill": 0.3,
"wire_width": 6.0
}
],
"meta": {
"version": 2
},
"net_colors": null
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "6502.net",
"specctra_dsn": "",
"step": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"drawing": {
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.25,
"pin_symbol_size": 0.0,
"text_offset_ratio": 0.08
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "Pcbnew",
"ngspice": {
"fix_include_paths": true,
"fix_passive_vals": false,
"meta": {
"version": 0
},
"model_mode": 0,
"workbook_filename": ""
},
"page_layout_descr_file": "",
"plot_directory": "",
"spice_adjust_passive_values": false,
"spice_external_command": "spice \"%I\"",
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"89a3dae6-dcb5-435b-a383-656b6a19a316",
""
],
[
"00000000-0000-0000-0000-0000610c69e2",
"RAM_VGA"
]
],
"text_variables": {}
}

9261
hardware/6502.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

9266
hardware/6502.kicad_sch-bak Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

2020
hardware/6502.sch-bak Executable file → Normal file

File diff suppressed because it is too large Load Diff

0
hardware/6502pcb.pdf Normal file → Executable file
View File

BIN
hardware/abn6502sbcR1.zip Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

6619
hardware/ram-vga.kicad_sch Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1745
hardware/ram-vga.sch-bak Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,15 @@
MEMORY {
ZP: start = $0, size = $100, type = rw, define = yes;
RAM: start = $200, size = $3E00, define = yes;
KBRAM: start = $200, size = $100, define = yes;
RAM: start = $300, size = $1C00, file = "build/userland.bin";
ROM: start = $8000, size = $8000, file = %O;
CROM: start = $10000, size = $10000, file = "build/crom.bin";
}
SEGMENTS {
USERLAND: load = RAM, type = rw;
RODATA: load = ROM, type = ro;
VECTORS: load = ROM, type = ro, offset = $7FFA;
CROM: load = CROM, type = ro;
PRIMM: load = ROM, start = $FFC8, type = overwrite;
}

234
software_linux/bootload.cpp Normal file
View File

@ -0,0 +1,234 @@
//This is a utility for wirelessly bootloading the ABNielsen.com 6502 SBC using an RF24 module of some sort.
//It is losely based on Daniel Beadle's nRF24L01 File Transfer - https://github.com/djbeadle/nRF24L01-File-Transfer
//Retransmit, checksum etc has been removed because the radio is reliable enough to detect bad packets - and we can
//simple restart if we miss a packet. Max file size is 64k - but the ABNielsen.com SBC only has 16K of RAM available
//of which 2k is VRAM and 512b is zp+stack.
//If you have the RF24 library installed on a Raspberry Pi this will compile with: g++ -Ofast -Wall -pthread -I/usr/local/include/RF24/.. -L/usr/local/lib bootload.cpp -lrf24 -o bootload
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <RF24/RF24.h>
#include <unistd.h>
// For stat:
#include <sys/stat.h>
#include <sys/types.h>
// For signal handler:
#include <csignal>
// For stol:
#include <string>
using namespace std;
RF24 radio(22,0);
/****************** Linux (BBB,x86,etc) ***********************/
// See http://tmrh20.github.io/RF24/pages.html for more information on usage
// See http://iotdk.intel.com/docs/master/mraa/ for more information on MRAA
// See https://www.kernel.org/doc/Documentation/spi/spidev for more information on SPIDEV
/**************************************************************/
// Radio pipe addresses for the 2 nodes to communicate.
//const uint64_t pipes[2] = {0xE7E7E7E7E7LL, 0xC2C2C2C2C2LL};
const uint64_t pipes[2] = {0xC2C2C2C2C2LL,0xE7E7E7E7E7LL};
static volatile int interrupt_flag = 0; // Catches Ctrl-c, for canceling transmisison
const int num_payload_bytes = 30; // 32 - 2 (header) - 1 (\0 at end) = 29 //No crc == 30
const int num_special_header_bytes = 2; // '\0' + some char
const int num_header_bytes = 2; // sizeof(uint16_t) = 2
void interrupt_handler(int nothing)
{
cin.clear();
cout << "Ctrl-c pressed! Ending transmission and truncuating file.\n";
interrupt_flag = 1;
}
size_t getFilesize (const char* filename){
struct stat st;
if(stat(filename, &st) != 0){
return 0;
}
return st.st_size;
}
int main(int argc, char** argv)
{
signal(SIGINT, interrupt_handler); // Ctrl-c interrupt handler
fstream *file;
//uint8_t *packets; // buffer to store all of the packets
char *filename = NULL;
uint8_t *packets; // buffer to store all of the packets
int errorcount = 0;
int c;
while ((c = getopt (argc, argv, "s:d:nmhD")) != -1)
{
switch (c)
{
case 'h':
cout << "This is a bootloader utility for the the ABNielsen.com 6502 SBC to be used with a nRF24 radio!\n";
cout << "It's built using TMRh20's C++ RF24 library, which can be found on Github:\n";
cout << "https://github.com/nRF24/RF24";
cout << "\n";
cout << "Usage:\n";
cout << "-h: Show this help text.\n";
cout << "-s: The source file. Use this on the transmitter.\n";
cout << "Examples:\n";
cout << "sudo ./bootload -s codetobeloadedin6502RAM.bin \n";
break;
case 's': // Specify source file
filename = optarg;
break;
case '?':
fprintf (stderr, "Unknown option `-%c'.\n", optopt);
return 6;
}
}
// Open the file
file = new fstream(filename, fstream::in);
if(!file)
{
cout << "Could not open the file.\n";
return 6;
}
radio.begin();
radio.enableDynamicPayloads();
radio.setRetries(15, 15);
radio.setChannel(2);
radio.setDataRate(RF24_2MBPS);
radio.openWritingPipe(pipes[1]);
radio.openReadingPipe(0, pipes[1]);
radio.printDetails();
// Send the very first packet with the filesize:
uint8_t first[32];
memset(&first, '\0', sizeof(first));
first[1] = '1';
uint32_t filesize = getFilesize(filename);
if(filesize == 0)
{
cout << "Error: Will not transmit an empty file!\n";
return 6;
}
if(filesize > 65536) {
cout << "Error: 64k is maximum file size.\n";
return 6;
}
memcpy(first+2, &filesize, 2);
cout << "Attempting to establish connection...";
cout.flush();
while(interrupt_flag == 0)
{
if(radio.write(first, sizeof(first)) == false)
{
cout << "Sending first packet failed.\n";
errorcount++;
if (errorcount > 10) {
cout << "Error: Too many retries.\n";
return 7;
}
}
else break;
}
int i;
for (i = 0;i<32; i++) {
printf("%02x ", first[i]);
}
if(interrupt_flag == 0)
{
cout << "Success!\n";
}
else
{
cout << "Attempt to establish a connection was canceled by the user.\n";
return 6;
}
// Calculate the number of pkts we're TX'ing
uint16_t total_num_pkts = filesize / num_payload_bytes;
// If filesize is not exactly divisible by
// num_payload_bytes we need an extra packet
if (filesize % num_payload_bytes != 0)
total_num_pkts += 1;
printf("Filesize: %d\n", filesize);
printf("Total Number of Packets: %d\n", total_num_pkts);
// Initalize the array we'll be transmitting
char packet[32];
memset(&packet, '\0', 32);
// Things we'll need later:
int eof = 0;
uint16_t special_ctr = 1; // This IDs the data pkts. Starts at 1, 0 is reserved for special packets
// Store all the packets in a buffer addressed by special_ctr
// TODO: don't store entire file in memory, instead use fseek
packets = (uint8_t*)malloc(num_payload_bytes * (total_num_pkts+1));
cout << "Beginning Transmission.\n";
// Read the entire file and store it into the packets array
while(eof==0 && interrupt_flag == 0)
{
// Transmit normal data packets
memset(packet, '\0', 32);
memcpy(packet, &special_ctr, 2);
for(int i = 0 + num_header_bytes; i < 32; i++)
{
file->get(packet[i]);
if(!*file)
{
cout << "Hit EOF!\n";
eof = 1;
break;
}
}
memcpy(packets + (num_payload_bytes * special_ctr), &packet[num_header_bytes], num_payload_bytes);
int x;
for (x = 0;x<32; x++) {
printf("%02x ", packet[x]);
};
int y;
for (y = 2;y<32; y++) {
if(packet[y] != 0x0a) printf("%c", packet[y]);
};
cout << "\n";
if(radio.write(&packet, 32))
{
cout << " Sent!\n";
usleep(40000); //This can be waaaaaaay smaller. We're not aiming for performance here though.
special_ctr++;
} else {
cout << " Failed. Restarting...\n";
sleep(1);
radio.write(first, sizeof(first));
special_ctr = 1;
file->seekg(0);
}
}
// Send the very last packet:
//uint8_t last[32];
//memset(&last, '\0', sizeof(last));
//radio.write(&last, sizeof(last));
free(packets);
}

20
userland.s Executable file
View File

@ -0,0 +1,20 @@
PRIMM = $FFC8 ; Userland can use ROM subroutines if we tell them where they are. Check listing.txt for current subroutine addresses
.feature string_escapes ; Allow c-style string escapes when using ca65
.segment "USERLAND"
userland:
jsr PRIMM
.asciiz "Testing CPU...\n"
cOhtwotest:
bra see02
jsr PRIMM
.asciiz "Hi! Im an NMOS 6502! \n"
jmp exitnow
see02:
jsr PRIMM
.asciiz "Hi! Im a CMOS 65C02! \n"
exitnow:
jsr PRIMM
.asciiz "Program finished. Returning to main.\n"
brk