Close

Line of the Raster

A project log for $1 entry to 1kB challenge

Let's use 1-dollar 8-pin PIC12C508A that has 512 words of program ROM (that is 768 bytes) and 25 bytes of data RAM...

shaosSHAOS 01/05/2017 at 06:050 Comments

So we will have 64 uS line where:

- 4 is blank before sync
- 5 is a sync
- 7 is blank after sync
- 48 is visible screen

PIC12C508/509 don't have interrupts, so we will simply call Line(s) subprogram(s) multiple times to generate proper raster:

; call ; 2/2
Line:
 nop ; 1/3
 nop ; 1/4

 ; video 48 instructions /52
 ... 

 clrf GPIO ; 1/53 -> video 48
 nop ; 1/54
 nop ; 1/55
 movlw 0x08 ; 1/56
 tris GPIO ; 1/57
 incf LineN,f ; 1/58 -> sync
 nop ; 1/59 -> sync
 nop ; 1/60 -> sync
 movlw 0x18 ; 1/61 -> sync
 tris GPIO ; 1/62 -> sync
 retlw 1 ; 2/64
For frame sync it will be special Line subprogram...

Discussions