I'm not sure if I'm having problems with SPI in general or "just" with the Display (DOGM132x-5) - either way, it doesn't display anything at all. I'm using the ATmega 8820AU (set the AVR Assembler to ATmega88, Assembler 2).
I hooked it up with 9 capacitors like in the datasheet example for "wide range" input, supply it with 3.3V
I connected these AVR pins and DOGM pins:
GND - dogCS1B PB0 - dogRS PB1 - dogA0 MOSI - dogSI SCK - dogSCL
I set the SPI to CPOL=1, CPHA=1, Freq: /4
The ÂµC clocks with 9,6MHz.
For sending data to the display, I RCALL this procedure (setting acc to the value being about to send before - acc is R16):
spi_send: OUT SPDR, acc spi_send_wait: IN acc, SPSR SBRS acc, SPIF RJMP spi_send_wait RET
which runs into an endless loop. So I changed it to:
spi_send: OUT SPDR, acc NOP (well over 40 times, tried with a lot more too) RET
which does run without an endless loop and should give enough time for SPI to send a byte successfully. Let's call it a debugging hack.
First, I pull dogmRS to GND, then to Vcc. The commands (A0=0) I send for initialization are these:
0b01000000 // start line set 0b10100000 // adc select 0b11001000 // common output mode select 0b10100110 // display normal/reverse 0b10100010 // lcd bias set 0b00101111 // power control 0b11111000 // booster ratio 0b00000000 // booster ratio, continued 0b00100011 // contrast 0b10000001 // contrast, continued 0b00011111 // contrast, continued 0b10101100 // static indicator 0b10101111 // display on
And then I try sending a character (80 = "P") to the display (A0=1).
And well, it does exactly nothing.
Some initialization that's happening before the above:
.DEF acc = R16 // accumulator 1 LDI acc, 0b00101011 // xtal,xtal,SCL,miso,SI,ss,A0,RS OUT DDRB, acc LDI acc, 0b00000000 // clear outputs, disable all pullups OUT PORTB, acc LDI acc, 0b11011100 // SPI master, prescaler 4 OUT SPCR, acc LDI acc, 0b00000000 // no 2x speed OUT SPSR, acc SEI
There's no endless loop, I have LEDs connected and light them once all code has run - they are on.
Can anyone here help me a little? I'm stuck and don't have a clue where to look. The forum search for dogm132* shows zero results, google isn't of great help either - and the datasheets don't give me much information.
Thanks for any help!