Close
0%
0%

BADGE FOR SUPERCON.6 / November 2022

After three years... Supercon again!
And the new badge too!

Similar projects worth following
YouTube video: https://youtu.be/ix__enrtYF4

4-bit processor simulated by 16-bit MCU. Registers, flags, ALU, SP, two Data Memory pages, current Program Word and some internal logic states are displayed in binary form, with 272 LEDs.
- A total of 31 instructions
- Processing speed: adjustable (in runtime) from 250,000 ips to 0.5 ips, plus Single Step
- Program Memory: 4096 pgm words × 12 bits
- Data Memory: 256 nibbles (32 visible in real time)
- 5-deep Subroutine Stack
- Opcodes/Operands are 4-bit aligned, visible on 3×16 LED disassembler display
- Three ways of programming:
1. Direct, using on-board buttons in Binary or Select mode
2. Indirect, using 2-pass assembler, created by Mike Szczys
3. Save/Load to/from computer or other badge (using serial I/O) or internal flash
- Bootloader for firmware update
- I/O port with 4-bit IN and 4-bit OUT
- 3V (2×AA) Battery supply
- SAO port with Serial I/O
- Detailed User Manual
- Dimensions 17.5×9.

1 Manual Rev4a.pdf

User Interface, Commands and Modes of Operation

Adobe Portable Document Format - 1013.21 kB - 11/11/2022 at 20:45

Preview
Download

2 Instruction Set Rev4.pdf

Detailed explanation of all instructions

Adobe Portable Document Format - 1.05 MB - 11/03/2022 at 02:25

Preview
Download

3 SFR Rev4a.pdf

Special Function Registers. NOTE: Revision 4a (Nov.03.2022) contains an error fix (page 24, KeyReg). Please use this revision if you have Rev4 or lower.

Adobe Portable Document Format - 647.36 kB - 11/04/2022 at 03:07

Preview
Download

4 DIR Mode Rev4.pdf

Instructions supported in Direct Mode (a simple mode, which does not support programming, Data Memory usage, Indirect Addressing and instructions with N or M operands)

Adobe Portable Document Format - 642.69 kB - 11/03/2022 at 02:24

Preview
Download

5 Hardware Rev4b.pdf

Schematic diagrams and characteristics

Adobe Portable Document Format - 614.59 kB - 11/04/2022 at 05:55

Preview
Download

View all 9 files

Enjoy this project?

Share

Discussions

Paul wrote 2 days ago point

If I did try to build it myself, what skills do I need?  I've ordered pcbs before and can solder.  Any really small SMD parts?  How much time does it take to put together?

What I love about this is project is that it is so accessible.  When my son asks me, "how does a computer work?" I believe this can be an answer.  It appears to expose an important layer of computing that is otherwise hard to grasp.  And it fits in your hand and lays out everything in front of you.  Such a great idea!

  Are you sure? yes | no

Voja Antonic wrote 2 days ago point

If you want to get the first soldering skills, I would strongly recommend practicing on some other platform, as this is an advanced challenge. Note that there are two decoders with only 0.635 mm pitch, which is not easy to solder.

First, you need a soldering iron with a good, thin tip, and I can say that 90% of soldering irons I've seen in workshops are unusable for such a task. Then you need a thin solder and a soldering flux, which you will wash with alcohol later.

Start with LEDs first (watch polarity!), then ICs (watch polarity again!), passive components and then wash it firmly in alcohol, with a small brush. Then solder buttons, they don't like washing in alcohol, as some oily flux can cover contact surfaces. But you can clean surrounding area by a piece of cloth with a little alcohol. At last, solder the Through-hole components, connector and battery holders.

Don't hurry! I need a few hours to solder one badge, which has 364 components. Here's how i do it - which does not mean that you have to do it the same way. First, I put a little solder on only ONE side of every component place on the PCB (all other have to be flat). For convenience, it is the right or top side (I'm right-handed). The I use a fine tweezers to place the component with my left hand, and use my right hand to hold the soldering iron and fix the component on one side only. Sometimes it is enough to use the solder which I already put on the pad in the first phase, and sometimes I need to take a little more. When I'm finished with one type of components (for instance LEDs), then I check the position of every component, as this is the last chance to fix the precise positions. Then I rotate the PCB for 180° and solder another side, holding a thin solder wire in my left hand. The I turn it again, and repair all pads from the first phase, sometime with some more solder.

With ICs, you will need a good loupe (I use the watchmaker's one), so that you can see shorts and bad joints on the fine ICs. Use a lot of flux here!

The most important thing: don't rush! Good luck!

  Are you sure? yes | no

Ken Yap wrote 2 days ago point

With the BOM and CPL files for PCBA you could get most of it assembled. This design has a lot of repeated parts and values and is amenable to PCBA. Sourcing particular parts like the MCU and getting them to the assembler is another problem but it's one you have to tackle anyway. Or you could do those bits yourself; I've found soldering SMD ICs far easier than SMD passives.

Sorry, not offering to take any steps in this direction. I like the design though.

  Are you sure? yes | no

Paul wrote 2 days ago point

Thanks @Ken Yap , any general idea of the cost.  I know a PCBs is pretty cheap.  Under $25 I think.  What is the general increase in cost with PCBA?

  Are you sure? yes | no

Ken Yap wrote 2 days ago point

@Paul  Sorry, it's highly dependent on design, board size, components, availability, offers, assembly house, etc. You just have to collect quotes. Here's an investigation for a small design of mine: https://hackaday.io/page/11900-costing-assembly-service-for-my-pcb

  Are you sure? yes | no

Paul wrote 5 hours ago point

@Ken Yap I'm getting a quote from JLCPCB but the CPL file for this project isn't identical.  They want Designator, Mid X, Mid Y, Layer, Rotation.  I guess I could just convert and drop the extraneous information?  Suppose that won't change the results?

[edit]  Converting to an XLS and fixing the columns (some weren't offset properly), and it at least identifies the parts.  It doesn't find many of them, like a lot of the resistors, so not sure the format in the ZIP is compatible with JLCPCB, but they do have a chat which might help.

Also, the preview shows all the buttons off the board.  Hilarious, as I imagine a robot dropping pieces on the floor :)  Not so funny as I'm paying for it :(  Anyways if you have any sage advice, I'd appreciate it, but I can update here as I make progress, or not.

  Are you sure? yes | no

Ken Yap wrote 2 hours ago point

@Paul There is no standardisation of BOM and CPL formats. You must follow the requirements of the fabrication house. JLC publishes their requirements on their website. CSV is easier to work with than XLS as a format, you can edit with a text editor. It's a pity the original design files weren't published. For my investigation I used KiCad so I had full control over the fabrication output files.

  Are you sure? yes | no

Paul wrote 4 days ago point

I want one as well.  I have researched a bit and I think one idea is that a Group Buy is the best way to get a final product rather than building one.  But I'm not sure if anybody has created a Group Buy nor do I know much about it...yet.

  Are you sure? yes | no

hwang_hoyoen wrote 5 days ago point

Sorry I am new in here. I have a question. How can i purchase this one?

  Are you sure? yes | no

Paul wrote 4 days ago point

Meant to post a reply ^^^

  Are you sure? yes | no

Voja Antonic wrote 3 days ago point

Sorry, it's not for sale. It's for conference visitors.

However, it is an open source project, so you can build it. The complete documentation can be downloaded. Just scroll up and click "View all 9 files".

  Are you sure? yes | no

hwang_hoyoen wrote 3 days ago point

okay, Thanks you so much

  Are you sure? yes | no

Malcolm wrote 11/21/2022 at 22:15 point

Hello! I've been looking at having one of these badges made using all the design files. I have a question though.

Due to the chip shortage I haven't been able to find the brains of the whole thing, PIC24FJ256GA704-I/PT anywhere. I did however spot some lesser PIC24FJ128GA204 MCUs online and was wondering if I could retro fit one into the design. The pin count, package, and pin out of the J128GA204 all match the original MCU, but I'm wondering if there are some other incompatibilities I might be overlooking. (Assuming that having half the flash space would be okay since I thought the firmware hex file is less than 128Kb.)

  Are you sure? yes | no

Voja Antonic wrote 7 days ago point

I don't think that it will work with the existing firmware. If you download the "1 Manual Rev4a.pdf" and look at the last page, you will see the memory organization of the system PIC. Firmware takes only about 48K of the program memory, but the rest is used as the firmware backup during the bootload process and for Flash storage, for program saving. 

So if you run it on the 128K MCU, it will stop execution and perform the Address Error Trap, which is fatal for program execution. The problem will occur in the initialization routine, shortly after Reset, when it loads pre-programmed samples to the Flash Program memory.

  Are you sure? yes | no

Malcolm wrote 6 days ago point

Darn! I just got the fabbed PCBs too. Well, thank you for the detailed response. When considering the flash space, I wasn't even thinking about these other mechanisms that go into simulating the 4-bit processor. Unless anyone knows of any possible way to get one of these chips, I'll have to hope the lead time doesn't keep getting pushed out. I guess I can use this time to learn more about the software portion and hopefully alleviate any future headaches too. 😅

  Are you sure? yes | no

Adrian Freed wrote 11/21/2022 at 21:35 point

Here is the project page with the documentation on the DAC/ADC board I gave you for the badge: https://hackaday.io/project/188326-badgeio-dacadcsiggenbuffers-for-supercon6

  Are you sure? yes | no

Voja Antonic wrote 11/21/2022 at 21:42 point

It's a good documentation. Thanks, Adrian!

  Are you sure? yes | no

Adrian Freed wrote 11/12/2022 at 04:14 point

Thanks for this great badge, Voja.
A few days before the conference an important inventor died at the age of 100: : Kathleen Booth. She designed and built some of the first computers and assemblers.  I wrote this assembler/code synthesizer for your badge in her honor: https://github.com/adrianfreed/Supercon6BadgeWork

  Are you sure? yes | no

Adrian Freed wrote 11/12/2022 at 04:39 point

Incidentally you can read about old machine design thoughts of the 40's and the first assembly code notations here: https://albert.ias.edu/handle/20.500.12111/7942

  Are you sure? yes | no

Ben Combee wrote 11/11/2022 at 06:57 point

I just spotted a typo in rev4 of the Manual. In your list of synthetic instructions on page 36, for LSL RY, I think that should be "ADD R0, 0", not "AND R0, 0".  The AND won't clear the carry, but the ADD will without affecting R0's value.

  Are you sure? yes | no

Voja Antonic wrote 11/11/2022 at 18:16 point

Both "ADD R0, 0" and "AND R0, N" reset Carry, but the first one affects Z and V flags too. If you look at the tables on the back of the badge, or pages 25-27 of the Instruction Set book, you will see that OR R0,N sets, AND R0,N resets and XOR R0,N toggles Carry. This is a way to affect Carry without affecting any register.

The similar approach was used in Z80, but OR/AND/XOR instructions only reset C, and two independent instructions (SCF and CCF) are used to set/complement Carry.

However, your note helped me to see my error in the Manual, as AND R0,0 actually clears R0. If you want to keep the contents of R0, then it's better to use AND R0, 0xF. This will be corrected in the next revision of the manual.

  Are you sure? yes | no

Ben Combee wrote 11/11/2022 at 19:35 point

Ah, I think my confusion was that the text for AND R0,n does indicate the C is unconditionally reset, while AND RX,RY says that C isn't affected. Thanks!

  Are you sure? yes | no

Mohit Bhoite | मोहित भोईटे wrote 11/08/2022 at 19:30 point

@Voja Antonic 
I can't imagine the amount of work you must have put into creating the user manuals and other documentation for this badge. They are all beautiful! I heard that you are using Corel Draw for creating these documentations, is that right? If so, what does that process look like? Are all the symbols created manually or is there a clipart library that you use for the schematics. How do you add junction symbols on the wires? manually?
Thanks!

  Are you sure? yes | no

Bob Long wrote 11/06/2022 at 23:37 point

For anyone making their own and wondering about LED orientation, I think it's anode (+) on the left and/or down for all of them. The pick-and-place file does not use cathode-left for zero-rotation. I had to check by importing the PCB into KiCAD, and then double checked by looking for a die in the high-res photos.

@Voja Antonic, could you please correct me if I am wrong? Would be good to get orientation information into the Placement.zip images

  Are you sure? yes | no

Voja Antonic wrote 11/07/2022 at 15:47 point

You are right about LED orientation, anode is always left, down or left-down. There's a marking which is invisible once it's not needed anymore, on the top silkscreen layer under the rightmost button. Enlarge the last (6th) image in the project gallery and note the yellow symbols at the bottom right. There's a number of LEDs (272) and orientation.

  Are you sure? yes | no

Bob Long wrote 11/07/2022 at 15:54 point

Ah, that's a great silkscreen indicator! I missed that. Thank you!

  Are you sure? yes | no

James Newton wrote 11/06/2022 at 17:18 point

@Voja Antonic May I humbly suggest that you edit the description to link the text 
"assembler, created by Mike Szczys"
In the description to the repo at:
https://github.com/Hack-a-Day/2022-Supercon6-Badge-Tools

  Are you sure? yes | no

TomKeddie wrote 11/05/2022 at 03:41 point

@Voja Antonic the files for my East Van addon board are at https://github.com/TomKeddie/prj-supercon2022/raw/12320199498d3a410aec8e213062e2ced3b3eca3/badge/Supercon%202022%20East%20Van%20Badge%20Addon%20Schematic.pdf and https://github.com/TomKeddie/prj-supercon2022/raw/main/badge/Supercon%202022%20East%20Van%20Badge%20Addon.pdf

Thanks for all your hard work.

  Are you sure? yes | no

cgeron wrote 11/04/2022 at 22:30 point

@Voja Antonic where can the challenge be found?

  Are you sure? yes | no

Voja Antonic wrote 11/05/2022 at 01:19 point

*  *  *  *  Here's the challenge:  *  *  *  *

You have to write the shortest possible program which does this:

- Load two random nibbles (see the 3.SFR manual page 26) in two registers, and
- Calculate the Parity bit for these 8 random bits.

So the result should be a single bit which tells you if the parity is even or odd. The program should be optimized so that it contains as few words as possible.

Please submit your solution here in the discussion group. The shortest program wins. If two or more programs have the same length, then the time of submission counts.

  Are you sure? yes | no

cgeron wrote 11/05/2022 at 05:42 point

9 lines is (I think) the smallest it can be made, if we make the assumption that the badge is in the state it is found in after a reset (input pins are pulled up, so special purpose register B on page 0 is all 1's). The result is found in the LSB of R1:

-  | Text                 |Instruction binary |Comments
0 | MOV R2,4      | 1001 0010 0100    |Counter for later
1  | MOV R0,[BB]  | 1011 1011 1011          |*Retrieve Rnd to R0
2 | MOV R1,R0     | 1000 0001 0000  |R1<-R0
3 | MOV R0,[BB]  | 1011 1011 1011          |*Retrieve Rnd to R0
   |Loop time
4  | XOR R1,R0     | 0111 0001 0000    |XOR R1 and R0, result in R1
5  | MOV R0,R1    | 1000 0000 0001  |Copy the result of the previous step to R0
6  | RRC R0          | 0000 1101 0000   |Shift R0 to the right
7  | DSZ R2          | 0000 0100 0010  |Decrement R2(counter) and check if 0
8  | JR -5              | 1111 1111 1011             |Jump relative -5

*Retrieving the Rnd register cannot be done by using MOV R0,[FF] because as specified in page 15 of the insruction set, MOV R0,[XY] requires indirect addressing with registers RX and RY. For this, register B was used since it is normally used as an input port register and is nominally pulled up. This code would still work with a single difference if register B cannot be assumed as 1's: an instruction would be added to the start to set R3 to 1111, and then the instructions currently on lines 1 and 3 would become "MOV R0[R3,R3]". Using register B is hacky...but that's the point :)

  Are you sure? yes | no

TheStumbler wrote 11/04/2022 at 05:08 point

also the parts placement diagram shows two each 10 uF caps, the second one not on the schematic but connected to the power pins of the two two ICs (shift registers?)

  Are you sure? yes | no

Voja Antonic wrote 11/04/2022 at 05:58 point

It's the power supply decoupling cap. There was an error on the schematics, please download the new version of the Hardware Rev4b.pdf

Two ICs are decoders 74HC138 (3-to-8 lines)

  Are you sure? yes | no

TheStumbler wrote 11/04/2022 at 05:05 point

How critical is the Vcap 10 uF capacitor in this design? The data sheet has some specific requirements for it but I’m not 100% sure it applies to this circuit board. 

  Are you sure? yes | no

Voja Antonic wrote 11/04/2022 at 06:03 point

Very critical. It is a low-ESR capacitor, used to stabilize the MCU's internal 1.8 V regulator voltage for the processor's core.

  Are you sure? yes | no

TheStumbler wrote 11/04/2022 at 06:06 point

oh. Then I’m dead I the water. I didn’t appreciate that critical part and didn’t order any. Looks like I don’t have anything close in my parts bins either. Oh well, another DK order and one more week. Looks like I’ll miss having it running at the same time as the conference is going on 

  Are you sure? yes | no

Voja Antonic wrote 11/04/2022 at 06:15 point

It's interesting that Microchip suggests that the distance between the MCU "Vcap" pin and the cap terminals should not exceed 0.25 inch (6 mm).

  Are you sure? yes | no

Voja Antonic wrote 11/04/2022 at 06:21 point

Also, if you order it, note that it should be rated for 16 or 25V, although it works at 1.8V only. It is surely because of its dynamic characteristics.

  Are you sure? yes | no

TheStumbler wrote 11/04/2022 at 20:38 point

oh. I just realized. I may be lucky. I have a couple of boards which use Microchip SAM processors and I might be able to steal a 10uF cap temporarily from one of them. Maybe 

  Are you sure? yes | no

Octavian Voicu wrote 11/03/2022 at 00:08 point

Can the Overflow flag be accessed by the program in any way, or is it just for debugging in single stepping mode? No instruction's output (including SKIP) depends on it and the flags seem to be internal to the ALU (not in user mem like other registers).

  Are you sure? yes | no

Voja Antonic wrote 11/03/2022 at 02:47 point

Overflow flag is accessible in the Special Function Registers area, at the address 0xF4 (RdFlags), bit 1. 

To let this flag affect the program flow, you can load RO with this register and then test bit 1 in R0, for instance...

1101 1111 0100         MOV R0, [0xF4]     ;  R0  <----  [RdFlags]
0000 1001 0001   BIT    R0, 1              ;  Z  <----  Vflag
0000 1111 1110        SKIP  NZ, 2            ;  Skip next 2 instructions if NZ
... next 2 instructions could be an absolute jump, like MOV PC, NN and MOV PCL, N

  Are you sure? yes | no

SHAOS wrote 11/03/2022 at 03:32 point

In my "unofficial" assembler RASM this code may look like this :)

@RDFLAGS EQU #F4

LABEL:
    LR0 @RDFLAGS    // R0  <----  [RdFlags]
    BIT_R0, 1    // Z  <----  Vflag
    SKIP_NZ,2    // Skip next 2 instructions if NZ
    JMP    LABEL    // an absolute jump, like MOV PC, NN and MOV PCL, N

and it will be assembled to this:

 000 0D LABEL:    LR0 @RDFLAGS    // R0  <----  [RdFlags]
     F4
 001 00        BIT_R0, 1    // Z  <----  Vflag
     91
 002 00        SKIP_NZ,2    // Skip next 2 instructions if NZ
     FE
 003 0E        JMP    LABEL    // an absolute jump, like MOV PC, NN and MOV PCL, N
     00
 004 09
     D0

  Are you sure? yes | no

Voja Antonic wrote 11/03/2022 at 03:38 point

Looks good.
I am so sorry that I couldn't try your assembler. Surely due to my inexperience with using GitHub repos. It seems that I'm not a good team worker :)

  Are you sure? yes | no

SHAOS wrote 11/03/2022 at 03:49 point

I'm pretty sure that "official" assembler is gonna be much prettier, but because it is not yet available I'm offering my "quick & dirty" solution to the public :)

I can build DOS binaries or MAC binaries or whatever binaries of RASM if anybody needs some ;)

  Are you sure? yes | no

Voja Antonic wrote 11/03/2022 at 03:59 point

I'm not sure that I could name it "official" assembler. It was written about two years ago by Mike Szczys and it works very good, but it must run under Python, which will probably limit a number of users.

I guess that it depends on the ease of application. There are people (like me) who are kind of "autistic" to some forms of interactions with the computer :(

  Are you sure? yes | no

SHAOS wrote 11/03/2022 at 04:02 point

Moreover "official" tools require Python 3.6+ as I heard which should limit number of users even more...

  Are you sure? yes | no

Octavian Voicu wrote 11/03/2022 at 14:04 point

Thanks, I missed that!

  Are you sure? yes | no

Octavian Voicu wrote 11/03/2022 at 14:24 point

A couple more questions related to the V flag:

- In the Instruction Set doc, the table on page 2, both CP R0,N and ADD R0,N are shown to affect the V flag (and this makes sense, since they're similar to ADD and SUB). However, in the Flags affected subsection for each instruction, the effect on the V flag is not documented. Is it just same as ADD/SUB?

- What about INC and DEC, do they affect the V flag? (not documented, so just checking).

Hint: I'm working on an emulator, hope to have something working today :)

  Are you sure? yes | no

SHAOS wrote 11/04/2022 at 03:43 point

One more Emulator? Great :)

  Are you sure? yes | no

Andy Geppert wrote 11/01/2022 at 17:44 point

If you think like I do... you'll appreciate page numbers added to the badge manuals. You can download them here: https://www.dropbox.com/sh/t0uu3ys5mftlv66/AAC3MJ9OSTowr2Yq4cLf6Jh1a?dl=0

  Are you sure? yes | no

Voja Antonic wrote 11/02/2022 at 17:12 point

I agree and I hope that I'll have enough time to do it before the Supercon. Unfortunately, manuals were written in CorelDraw, so I have either to do it manually for every page or to reformat PDF pages for every new revision.

Thanks!

  Are you sure? yes | no

Voja Antonic wrote 11/03/2022 at 02:49 point

Done. Revision 4 contains page numbers.

  Are you sure? yes | no

SHAOS wrote 10/30/2022 at 11:25 point

My "unofficial" assembler is released: https://hackaday.io/project/158426
Now I'm going to create a number of sample programs and may be emulator ;)

  Are you sure? yes | no

Stefano wrote 10/27/2022 at 19:04 point

There are example programs?

  Are you sure? yes | no

Voja Antonic wrote 10/28/2022 at 00:28 point

At this moment, there are only two sample pre-loaded programs with the code that can be regularly edited, ran in different speeds or single-stepped. One of them simulates the moving message display with Shakespeare's Hamlet :) and another one is used for Serial In demonstration, with UART_ASCII-to-text conversion.

However, all subsequently written programs will be exchangeable via Internet and up/downloadable via Serial port. The same applies to the main firmware, which can be bootloaded in case the new version appears.

  Are you sure? yes | no

SimonGurney wrote 10/27/2022 at 18:29 point

Any chance of buying one of these?  I'm in the UK and have no chance of getting out to SuperCon 😭

  Are you sure? yes | no

Voja Antonic wrote 10/28/2022 at 00:16 point

I'm not sure. Knowing the production process, there will hardly be any leftovers and subsequent sales were not planned.

  Are you sure? yes | no

TheStumbler wrote 10/27/2022 at 12:57 point

where’d you get the PIC24F256 chips? I just got all the parts and the PCB. But I can’t find the PIC anywhere. 

  Are you sure? yes | no

Voja Antonic wrote 10/28/2022 at 00:12 point

The prototypes were built more than 2.5 years ago, when MCUs were regularly available, and we were careful enough to order the production batch directly from Microchip in the spring this year.

I checked and Microchip estimates that 24,320 pieces are going to be available on 19-Dec-2022. Price is $2.05 for quantities 1 to 24. However, I'm not sure that you can order a small quantity, as they gave prices for 1-24 and 25-99 pieces, but then they used the order form with a note "Multiples of 160". Please check it here:

https://www.microchipdirect.com/product/PIC24FJ256GA704-I/PT?productLoaded=true

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates