I have been trying to port code based on the UTFT library: http://gizmogarage.net/fast-avr-...
I am using an ATMEGA128A with a 3.2" LCD from sainsmart (uses SSD1289) http://www.sainsmart.com/sainsma...
I have designed my own PCB and have been able to get about as far as blinking a status LED.
My problem is that I when I have tried to import the fast UTFT library I get loads of errors that I don't know how to resolve (I'm new to AVRs that aren't in arduino boards).
The error I am currently stuck on is "Number must be positive and less than 64" this occurs many times in my code but on firstly on the line:
/* this block sets up the TOGGLE_WR_FAST registers r30:r31 */ in r26, _SFR_IO_ADDR(WR_PORT) //This line //lds r26, _SFR_IO_ADDR(WR_PORT) This line was suggested in/out to lds/sts mov r27, r26 set bld r26,WR_PIN clt bld r27,WR_PIN movw r30, r22 FB1BIT_LOOP: LPM r0, Z+ PLOT_MONO_PIXEL r0,7 PLOT_MONO_PIXEL r0,6 PLOT_MONO_PIXEL r0,5 PLOT_MONO_PIXEL r0,4 PLOT_MONO_PIXEL r0,3 PLOT_MONO_PIXEL r0,2 PLOT_MONO_PIXEL r0,1 PLOT_MONO_PIXEL r0,0 SUB16 r24,r25,1 cpi r24,0 cpc r25,r1 breq FB1BIT_DONE jmp FB1BIT_LOOP
WR_PORT = PORTG
I have set the fuse to turn off compatibility mode in the ATMEGA128A (M103C) so I should be able to use this port like a standard IO port
I would really appreciate some help with this.
I have attached the Fast UTFT project as a .zip
Many thanks in advance