workshop notes -------------- DAY 1 * getting started : down to the metal : what it is about - pic chip: has machine code - why forth? - interactive - easier than machine code - still fairly close to the metal (similar to C) - divide and conquer : use small TESTABLE functions - closer to functional programming - why not standard forth? - forth is a paradigmn (A forth) - stacks & words is all there is - stay close to the real thing (real programmer :) - why PURRR ? - target contains only machine code - the host contains all symbolic representations - the host can perform optimizations (chip to small for smart compiler) * loading files + uploading to the microcontroller - 'ping' to check if the chip is there - 'load' converts forth to assembler (see 'pa') - 'commit' converts assembler to code on chip - 'mark' marks the chip, so a later 'empty' can restore the state - compile mode: ctrl-D DAY 2 * stack operations - dup swap drop + - and xor - @ ! - hexadecimal numbers - 8 bit numbers * defining new words - use ':' and ';' to create new FLASH executable code - use 'variable' to create a RAM variable - use 'constant' to create a constant value * for .. next * delay loops * blink-a-led : LATA * begin .. until * conditions * 'ping' interruption * video signals : a bit of theory * how to do it on the pic : using a timer at line frequency * for .. next * begin .. until * hooks: change behaviour after 'burning' * logo.f * ball.f * lfsr.f -> random numbers