The Artima Developer Community
Sponsored Link

Python Buzz Forum
06

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Aaron Brady

Posts: 576
Nickname: insommeuk
Registered: Aug, 2003

Aaron Brady is lead developer for Crestsource
06 Posted: Jun 6, 2016 5:19 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Aaron Brady.
Original Post: 06
Feed Title: insom.me.uk
Feed URL: http://feeds2.feedburner.com/insommeuk
Feed Description: Posts related to using Python. Some tricks and tips, observations, hacks, and the Brand New Things.
Latest Python Buzz Posts
Latest Python Buzz Posts by Aaron Brady
Latest Posts From insom.me.uk

Advertisement

I got my Forth green square.

Mecrisp Hello World

Bas’ and my LCD driver for the PCD8544 display is now in the upstream Embello repository. The API it exports to the graphics.fs library is just three words:

: putpixel ( x y -- ) ;
: clear ( -- ) ;
: display ( -- ) ;

Of course, there’s quite a bit under the hood. putpixel was challenging and he fact that dup dup and 2dup do very different things was time consuming to find, but now it’s done.

I love this environment and have given AmForth a go on a spare Arduino Uno. Using AmForth as a read-eval-print-loop allowed for interactively exploring an STP16CL596 (16 bit shift register / current sink) hooked up to a common anode LED matrix (5x7).

It’s slow. Way slower than Mecrisp, but then the CPU is 8bit instead of 32bit and the clock is only 16MHz instead of 72Mhz, so that’s to be expected really. It’s still as low level though, let’s set PORTD pins 2 through 6 to output, then turn on PD2

$7C DDRD c!
$4 PORTD c!

Okay, so this is just the same as

DDRD = 0x7c;
PORTD = 0x4;

in C, but the important part is there was no compilation step inbetween - just poke bits of RAM and see what happens - if anything goes wrong, just hit reset and try again.

Unfortunately the speed is an issue. Bas plans to drive the matrix display with persistence of vision, and neither of us thinks we can optimise the Forth enough to make that work at just 16Mhz.

Back to C, it is.

Read: 06

Topic: 09 Previous Topic   Next Topic Topic: 25

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use