Open-sourcing FIGnition

188 views
Skip to first unread message

Julian Skidmore

unread,
Sep 26, 2011, 12:22:50 PM9/26/11
to FIGnition
Hi folks,

I've finally begun the process of open-sourcing FIGnition:

https://github.com/Snial/FIGnition

I'm using git and github to do it - though I had been trying to use Subversion for quite a long time. It turns out... git is frankly far easier :-) !

You'll notice that some of FIGnition is opened, and I'll be releasing the rest as soon as I'm ready, which, hopefully won't be too long from now. This will include circuit diagrams.

Anyway, this is a start. With the current release you should be able to build FIGnition .hex files, though it's not trivial and I'll post something in a bit about the process I go through. The current release will give you enough information to add your own keyboard drivers. So, you could add a PS/2 interface via J5-6 which blocks the PS/2 keyboard during video scanning and releases it when in the video margins to process keys. That way, you won't mess up the screen when reading keys. I've also provided the code for the Flash Chip and my SPI code. Again I'll add more details tomorrow. In the meantime, feel free to take a look at the code!

-cheers from julz

--
                             
                  The DIY 8-bit computer from nichemachines™


NmLogoMini.jpg
FIG - black on whiteMini.jpg

Artem Gnilov

unread,
Sep 26, 2011, 12:49:40 PM9/26/11
to fign...@googlegroups.com
Awesome!

Simon

unread,
Sep 26, 2011, 1:16:06 PM9/26/11
to fign...@googlegroups.com
Ah, yes! Way to go Julz.

Julz

unread,
Sep 27, 2011, 7:42:27 AM9/27/11
to FIGnition
Hi guys,

Thanks for the encouragement!

I've now added the stripes circuits to the GitHub, along with a
ReadMe; the StartupScreen.c and a couple of Wiki pages.

https://github.com/Snial/FIGnition/wiki

The Readme tells you how to build the FIGnition software. Let me know
when/if you're successful.

The useful Wiki page tells you how to add an external keyboard, such
as a PS/2 keyboard. It gives you a couple of links. I don't plan to
have further involvement with that side of things - because I think
there's more potential in the current keypad. But at least people can
do a proper job of it now.

-cheers from julz

Artem Gnilov

unread,
Sep 27, 2011, 8:42:38 AM9/27/11
to fign...@googlegroups.com
Github wiki is very useful feature. As well as Github pages (http://pages.github.com/).

Simon

unread,
Sep 28, 2011, 1:27:00 PM9/28/11
to fign...@googlegroups.com
Confirming, after some trouble, getting the source from github.  I chose to use SmartGIT as my client.  The trouble - for anyone who is also trying this - was that I needed to 'clone' the project from github first.   No amount of Pulling or Synchronising would work.

So now to get avr_gcc of my memory stick and lets see if this sucka compiles eh?  I have bravely opted for the portable avr tools so I can keep it all on a memory stick!  If that works I shall blow the trumpet marked 'triumph' for all I'm worth.

Simon

unread,
Sep 28, 2011, 2:02:27 PM9/28/11
to fign...@googlegroups.com
There was me thinking this would be easy peasy lemon squeezy.  No.

I don't have an apple computer so this is being done with Windows 7.  The portable avr tools come with all the bit's n pieces, make, avr-gcc etc.  Cool.  There is a batch file to start a console window, which locates the avr tools' bin folder and ... E:\ prompt.

Type in make FIGnition.hex

E:\FIGnition\Firmware>make FIGnition.hex
make: *** No rule to make target `obj/Unclassified.s', needed by `FIGnition.elf'.  Stop.

This may take a while to sort out. 

Julian Skidmore

unread,
Sep 29, 2011, 3:01:38 AM9/29/11
to fign...@googlegroups.com
Hi Simon,

Thanks for downloading it. It sounds like a problem with the makefile. There should be a complete set of .o files in obj/ including Unclassified.o so it doesn't need to make it from Unclassified.s.

Unclassified.s doesn't contain much, just my timer assisted Serial out routine - it's bit banged, but uses timer 0's OC0A I think to automatically output the next bit at the right time, so it has a low enough latency to use with the video generator, except I haven't really used it since early January and the setup is disabled by default.

Unclassified also had a LED blink test routine for when I was experimenting with pure gcc assembler files.

Finally, Unclassified has a routine which allows you to call another C routine from your interrupt routine - of course you can always do that, but if you do you find that avr-gcc pushes all your registers on entry to the interrupt routine thus increasing the latency, my bridging code means I only take the hit when I need to.

I'll do some checking today.

-cheers from julz
FIG - black on whiteMini.jpg
NmLogoMini.jpg

Julian Skidmore

unread,
Sep 29, 2011, 3:05:10 AM9/29/11
to fign...@googlegroups.com
Hi Simon,

Another thing to bear in mind is that the normal avr-gcc environment is winavr, but I don't know if it provides conventional unix-like console support. If it doesn't I guess you'd use mingw.
FIG - black on whiteMini.jpg
NmLogoMini.jpg

Simon

unread,
Sep 29, 2011, 6:20:19 AM9/29/11
to fign...@googlegroups.com
It is using mingw.  Quite clever!

Anyhoo - the makefile debugging is ongoing.  Using make -n -d FIGnition.hex reveals a bit:

Updating goal targets....
Considering target file `FIGnition.hex'.
  Considering target file `FIGnition.elf'.
    Considering target file `obj/Unclassified.s'.
     File `obj/Unclassified.s' does not exist.
     Looking for an implicit rule for `obj/Unclassified.s'.
     Trying pattern rule with stem `Unclassified.s'.
     Trying implicit prerequisite `obj/Unclassified.s,v'.
     Trying pattern rule with stem `Unclassified.s'.
     Trying implicit prerequisite `obj/RCS/Unclassified.s,v'.
     Trying pattern rule with stem `Unclassified.s'.
     Trying implicit prerequisite `obj/RCS/Unclassified.s'.
     Trying pattern rule with stem `Unclassified.s'.
     Trying implicit prerequisite `obj/s.Unclassified.s'.
     Trying pattern rule with stem `Unclassified.s'.
     Trying implicit prerequisite `obj/SCCS/s.Unclassified.s'.
     No implicit rule found for `obj/Unclassified.s'.
     Finished prerequisites of target file `obj/Unclassified.s'.
    Must remake target `obj/Unclassified.s'.
make: *** No rule to make target `obj/Unclassified.s', needed by `FIGnition.elf'
.  Stop.

So the rules are looking for .s files when it's checking the dependencies of FIGnition.elf.  I believe the problem is the rules to get the object files (*.o) created.

We have good old "%.o : %.c" but it doesn't get used for some reason.  Hmmm.


Julian Skidmore

unread,
Sep 29, 2011, 6:31:59 AM9/29/11
to fign...@googlegroups.com
Hi Simon,

Glad the tools are in place. "%.o : %.c"  is used, but the only .c file in the current directory also has a .o so nothing needs to be compiled. This is probably known as... bad form :-S !

-cheers from julz
FIG - black on whiteMini.jpg
NmLogoMini.jpg

Simon

unread,
Sep 29, 2011, 6:47:08 AM9/29/11
to fign...@googlegroups.com
Curious (is that a Spock reference or has that now moved on to Sheldon?).  

A "make clean" - works ok.  ... followed by a "make FIGnition.elf"... recompiles all the .c files and new .o files in the obj directory.  Definite progress.

Then it fixates on the missing "obj/Unclassified.s" which is actually in the src directory.  I presume that it was not genereated by compiling from a C source file.

E:\FIGnition\Firmware>make clean
rm -f *.hex *.elf obj/Unclassified.s obj/AmicFlashSpi.o obj/FigEdit.o  obj/FigKeyDrv.o obj/FIGnition.o obj/FIGnitionMem.o obj/FigVFlash.o obj/ForthDebug.o obj/GraphIO.o obj/LLDebug.o obj/MicrochipSramSpi.o obj/Spi.o obj/StartScreen.o obj/Unclassified.o obj/Video.o obj/VideoScan.o obj/VM.o obj/VMFast.o obj/VMTest.o obj/FigForth.o

E:\FIGnition\Firmware>make FIGnition.elf
avr-gcc -Wall -Os -DF_CPU=20000000 -mmcu=atmega168 -fno-inline -Iinc/ -c src/AmicFlashSpi.c -o obj/AmicFlashSpi.o
avr-gcc -Wall -Os -DF_CPU=20000000 -mmcu=atmega168 -fno-inline -Iinc/ -c src/FigKeyDrv.c -o obj/FigKeyDrv.o
avr-gcc -Wall -Os -DF_CPU=20000000 -mmcu=atmega168 -fno-inline -Iinc/ -c src/FIGnition.c -o obj/FIGnition.o
src/FIGnition.c:195: warning: return type of 'main' is not 'int'
avr-gcc -Wall -Os -DF_CPU=20000000 -mmcu=atmega168 -fno-inline -Iinc/ -c src/FIGnitionMem.c -o obj/FIGnitionMem.o
src/FIGnitionMem.c: In function 'InterruptSpi':
src/FIGnitionMem.c:74: warning: unused variable 'data'
avr-gcc -Wall -Os -DF_CPU=20000000 -mmcu=atmega168 -fno-inline -Iinc/ -c src/FigVFlash.c -o obj/FigVFlash.o
avr-gcc -Wall -Os -DF_CPU=20000000 -mmcu=atmega168 -fno-inline -Iinc/ -c src/MicrochipSramSpi.c -o obj/MicrochipSramSpi.o
src/MicrochipSramSpi.c: In function 'SramAbsBeginRd':
src/MicrochipSramSpi.c:96: warning: unused variable 'data'
avr-gcc -Wall -Os -DF_CPU=20000000 -mmcu=atmega168 -fno-inline -Iinc/ -c src/Spi.c -o obj/Spi.o
avr-gcc -Wall -Os -DF_CPU=20000000 -mmcu=atmega168 -fno-inline -Iinc/ -c src/StartScreen.c -o obj/StartScreen.o
avr-gcc -Wall -Os -DF_CPU=20000000 -mmcu=atmega168 -fno-inline -Iinc/ -DRamBase=0x8000 -x assembler-with-cpp -c src/Unclassified.s -o obj/Unclassified.o

Simon

unread,
Sep 29, 2011, 6:50:20 AM9/29/11
to fign...@googlegroups.com
Suspicious of:

SRCDIR = src/
CSRCS := $(wildcard $(SRCDIR)*.c)
ASMSRCS := $(wildcard $(SRCDIR)*.s)
ASM2SRCS := $(wildcard $(SRCDIR)*.S)
OBJDIR = obj/
ObjectsFromSRC := $(subst $(SRCDIR),$(OBJDIR), $(patsubst %.c,%.o,$(CSRCS)) \
$(patsubst %.s,%.o,$(ASMSRCS)) \
$(patsubst %.S,%.o,$(ASM2SRCS)) )

Julian Skidmore

unread,
Sep 29, 2011, 7:06:08 AM9/29/11
to fign...@googlegroups.com
Hi Simon,

It won't work if you do clean, because FIGnition isn't fully open sourced yet. Some files are as yet just .o files.

The objects from source pattern substitution should work OK. There's 2 parts:


$(patsubst %.c,%.o,$(CSRCS)) \
$(patsubst %.s,%.o,$(ASMSRCS)) \
$(patsubst %.S,%.o,$(ASM2SRCS))

which takes all the c source files and replaces the .c ending with .o. Then all the ASM sources which replace all the .s's with .o's and finally the same is done for .S.

Then $(subst $(SRCDIR),$(OBJDIR), ..... ) is run on all of that, substituting all occurances of the src directory with the obj directory. So it should work the same way for all 3.

-cheers from julz
NmLogoMini.jpg
FIG - black on whiteMini.jpg

Simon

unread,
Sep 29, 2011, 7:15:19 AM9/29/11
to fign...@googlegroups.com
Ah, right.  I see.  Ok, I'll get the objects from the GIT repository... again.  :)

Enjoying myself!

Simon

unread,
Sep 29, 2011, 3:02:16 PM9/29/11
to fign...@googlegroups.com
I've got the objects and targets back now.  So now back to figuring why it thinks is needs a rule to resolve obj/Unclassified.s

Simon

unread,
Sep 29, 2011, 4:04:34 PM9/29/11
to fign...@googlegroups.com
Found it.  The cause is GNU make on Windows does not differentiate between the case of filenames; hence the following are all equivalent:
  1. Unclassified.s
  2. Unclassified.S
  3. unCLASSified.S
  4. uNcLaSiFiEd.S
The Makefile variables to define the list of assembler source files are defined as:

ASMSRCS := $(wildcard $(SRCDIR)*.s)
ASM2SRCS := $(wildcard $(SRCDIR)*.S)

... both contained the same text/value = src/Unclassified.s.  ASM2SRCS should not contain anything.  Then later the variable OBJECTS ended up with obj/Unclassified.s in it, nothing else.  Not sure why.  There was no rule to tell make what to do with a .s in the obj directory.

To repair the makefile on Windows change the line:

ASM2SRCS := $(wildcard $(SRCDIR)*.S)

to 

#ASM2SRCS := $(wildcard $(SRCDIR)*.S)

Julian Skidmore

unread,
Sep 30, 2011, 2:25:54 AM9/30/11
to fign...@googlegroups.com
Hi Simon,

Of course!!!! So I'll change the .S file (there's only 1) to .s.

-cheers from julz
NmLogoMini.jpg
FIG - black on whiteMini.jpg

Artem Gnilov

unread,
Oct 3, 2011, 8:49:10 AM10/3/11
to fign...@googlegroups.com
Hi there,
I've published the news about open-sourcing FIGnition's firmware in the open-source russian-speaking community: http://j.mp/nevzwc

Julian Skidmore

unread,
Oct 3, 2011, 9:17:23 AM10/3/11
to fign...@googlegroups.com
Hi Artem,

Thanks. Sorry about not being able to update the GitHub code today to match the current Firmware release (0.9.5). Good idea with the wiki membership list!

-cheers from julz


On Mon, Oct 3, 2011 at 1:49 PM, Artem Gnilov <boo...@gmail.com> wrote:
Hi there,
I've published the news about open-sourcing FIGnition's firmware in the open-source russian-speaking community: http://j.mp/nevzwc



FIG - black on whiteMini.jpg
NmLogoMini.jpg

Julian Skidmore

unread,
Oct 3, 2011, 9:18:20 AM10/3/11
to fign...@googlegroups.com
Hi Artem,

(and everyone else)... that is sorry I haven't *yet* updated it, busy doing other things.

-cheers from julz
NmLogoMini.jpg
FIG - black on whiteMini.jpg

Julian Skidmore

unread,
Oct 4, 2011, 8:29:47 AM10/4/11
to fign...@googlegroups.com
Hi guys,

There's a new GitHub update. It includes the following changes:

* There's now a Samples directory which contains samples of Forth programs: Banner, Debugger, GDemo, Life, Oxo, TJoy.

* The distribution is up-to-date with 0.9.5, it'll generate that image.

* The distribution can be cloned and compiled correctly.

* There's no longer a dependency on FigForth.S.

Hope this helps!

-cheers from julz
NmLogoMini.jpg
FIG - black on whiteMini.jpg

Andrew Hannay

unread,
May 16, 2013, 6:03:30 AM5/16/13
to fign...@googlegroups.com
I'm working on a Schematic for the fignition using Eagle designer and will post it. Is this ok?
Andrew
 

Julian Skidmore

unread,
May 16, 2013, 6:19:15 AM5/16/13
to fign...@googlegroups.com
Hi Andrew,

FIGnition is open-source, so yes there are no restrictions on
publishing a FIGnition schematic. The only reason one hadn't existed
before is because my PCB designer Osmond X designs straight to PCBs
without requiring them.

One caveat, I'd post it here as a pre-1.0 schematic, and then when
it's been verified; release it more widely. For example,
hypothetically I might want to suggest changing some signal names for
the sake of naming conventions or there might be suggestions on moving
component blocks around.

But yes, it'd be great to have a real FIGnition schematic.

-cheers from julz
> --
> You received this message because you are subscribed to the Google Groups
> "FIGnition" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fignition+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


--

Andrew Hannay

unread,
May 16, 2013, 6:25:56 AM5/16/13
to fign...@googlegroups.com
Cool. It's most definitely at pre 1.0 stage.
Eagle has an awful way of representing the ATMEGA device by sticking most of the I/O pins on one side and the power pins on the other (with Gnd above the Vcc pins !!!).
Cheers,
Andrew
 


You received this message because you are subscribed to a topic in the Google Groups "FIGnition" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fignition/WqGTZpxJY1E/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to fignition+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages