Skip to content

Programming the 1802 From the Macbook II

March 24, 2015

I’m back working with the Mac. I have lcc1802 and the assembler working and even avrdude. I’m using Atom for an editor but it doesn’t seem to have hooks for executing the compiler and loader so i’m using a separate shell and some crude shell scripts.

I set up a directory called /usr/local/sh and put in scripts to run the lcc1802 compiler, the asw assembler, and avrdude.

/Users/bill/Documents/lcc/lcc1802/lcc42/build/cpp -I/Users/bill/Documents/lcc/lcc1802/include $1.c | /Users/bill/Documents/lcc/lcc1802/lcc42/build/rcc -target=xr18DH >$1.s
~/Documents/asl-current/asl -q -cpu 1802 -i ~/Documents/lcc/lcc1802/include $1.s &&~/Documents/asl-current/p2hex $1.p $1.hex>p2hex.log
avrdude -u -V -D -patmega644p -cstk500v1 -b57600 -P/dev/cu.usbserial-FTWUA7K0 -U flash:w:$1.hex

Apparently the tradition on a mac is to put scripts in /usr/local/bin but there’s already a lot of stuff in there and this way if i forget what one of my cryptic shells does or is called, it’s easier to find it. I added my directory to the $PATH system variable with
echo ‘PATH=$PATH:/usr/local/sh’ >> ~/.bash_profile
which I got from here (which is also where i found out how to get avrdude)

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: