Shop OBEX P1 Docs P2 Docs Learn Events
LCD touchscreen, A development thread — Parallax Forums

LCD touchscreen, A development thread

average joeaverage joe Posts: 795
edited 2012-04-03 07:09 in Propeller 1
The purpose of this thread is to gather information about using LCD touchscreens with the propeller chip. There is some great information out there but it seems a lot of people, myself included, have a lot of questions.

The first task is getting the hardware implementation figured out. There are many ways of interfacing these displays. I have a basic layout that I hope will give a starting point for development. The LCD module is wired directly to the propeller, combining the SD card and Touch data and clock pins. Sd card and touch chip selects are controlled directly by the prop, as is LCD reset and RS and WR. LCD CS is not used and connected to ground. LCD RD is not used and connected to +3.3v. Pins 26-27 are used as an ac-coupled sigma-delta analog to digital converter.
An earlier version of my schematic was missing the resistor for LCD backlight, this has been fixed.

As far as code goes, I'm still trying to figure out init procedure. Here's what I have so far.
CON
  RS                   = 16
  WR                  = 17
  LCD_RST         = 23
  
OBJ  
    wait    : "timing"                                    ' thanks to parallax   
      
PUB Start_SSD1289
    EnableDisplayPins                                     ' enable pins 0 to 15

    ResetHigh
    wait.pause1ms(5)

    ResetLow
    wait.pause1ms(5)
    ResetHigh

    WriteHigh
    wait.pause1ms(5)

    Lcd_Write_Com ($00,$07)     ''Display Control (R07h) (POR = 0000h) 
    Lcd_Write_Data($00,$21)     ''GON = 1 DTE = 0 D[1:0] = 01 
    
    Lcd_Write_Com ($00,$00)     ''Oscillator (R00h) (POR = 0000h)
    Lcd_Write_Data($00,$01)     ''
    
    Lcd_Write_Com ($00,$07)     ''Display Control (R07h) (POR = 0000h)
    Lcd_Write_Data($00,$23)     ''GON = 1 DTE = 0 D[1:0] = 11

    Lcd_Write_Com ($00,$10)     ''Sleep mode (R10h) (POR = 0001h)
    Lcd_Write_Data($00,$00)     ''
        
    Lcd_Write_Com ($00,$07)     ''Display Control (R07h) (POR = 0000h)
    Lcd_Write_Data($00,$33)     ''GON = 1 DTE = 1 D[1:0] = 11

    Lcd_Write_Com ($00,$11)     ''Entry Mode (R11h) (POR = 6830h)
    Lcd_Write_Data($68,$30)     ''    

    Lcd_Write_Com ($00,$02)     ''LCD-Driving-Waveform Control (R02h) (POR = 0000h)
    Lcd_Write_Data($10,$00)     ''

    Lcd_Write_Com ($00,$0F)     ''Gate Scan Position (R0Fh) (POR = 0000h)
    Lcd_Write_Data($00,$00)     ''    

    Lcd_Write_Com ($00,$01)     ''Driver Output Control (R01h) (POR = [0XXXX0X1]3Fh)
    Lcd_Write_Data($2B,$3F)     ''

    Lcd_Write_Com ($00,$0B)     ''Frame Cycle Control (R0Bh) (POR = 5308h)
    Lcd_Write_Data($53,$08)    

'
    Lcd_Write_Com ($00,$07)     ''Display Control (R07h) (POR = 0000h)
    Lcd_Write_Data($00,$3B)     ''GON = 1 DTE = 1 D[1:0] = 11  CM = 1 65K COLOR
                                         
'********************** private methods *********************
PRI LCD_Writ_Bus(VH,VL) 
    OUTA[7..0]  := VL
    OUTA[15..8] := VH
    WriteLow                                            ' write pin low
    WriteHigh                                           ' toggle write pin

PRI Lcd_Write_Com(VH,VL)
    RSLow
    LCD_Writ_Bus(VH,VL)

PRI Lcd_Write_Data(VH,VL)
    RSHigh
    LCD_Writ_Bus(VH,VL)    

PRI EnableDisplayPins
    DIRA:=%00000000_10000011_11111111_11111111 ' , Reset, WR, RS and 16 data lines active    
PRI TristateDisplayPins ' tristate all pins - 
    DIRA:=%00000000_10000011_00000000_00000000
PRI RSLow                                    ' RS pin
 outa[RS] := 0                  
PRI RSHigh
 outa[RS] := 1                 '
PRI WriteLow                                    
    outa[WR] := 0                             ' 
PRI WriteHigh
    outa[WR] := 1 
PRI ResetLow                                    
    outa[LCD_RST] := 0                        ' 
PRI ResetHigh
    outa[LCD_RST] := 1    
This is based off Dr. Acula's work on the ILI9325 driver. Not sure where to go from here.

A note on the hardware. This HW revision is early. I plan on implementing a 2-4 line decoder for the LCD_RESET, SD_CD and touch_cs lines. The final line will be used for address decoding described next. The serial lines will be cascaded to other modules *3 at this time* Serial Data out will flow through a serial-in, parallel-out shift register which will use 3 lines for address. These 3 lines will be fed into a 138, with an enable strobe from previous stage. The final 8 lines will control CS for serial devices. Serial Data Out will be taken from Q3 of shift register. Or something like that.


LCD_Rev1.jpg
sigmaADC.jpg
lcd.jpg
1024 x 647 - 77K
191 x 320 - 14K
430 x 720 - 56K
«1345

Comments

  • average joeaverage joe Posts: 795
    edited 2012-02-17 05:34
    I wrote a simple test program, just to make sure the display powers on. I'm posting code, A big thanks to DR. A and his thread. I have a TON of work left, but this is a start.
    lcdTest.jpg


    On the to-do list... Implement Registers for draw control. Test Sd_Card, Touch. I'm also thinking about extended memory... I want to use an SD card. I DO want FAT support, but I plan on bypassing FAT for Extended Memory. I'm also wondering about the font on the prop's ROM. I'll edit this post when the youtube video finishes uploading... NOW
    http://youtu.be/smPEVZgX_uQ
    320 x 191 - 8K
  • average joeaverage joe Posts: 795
    edited 2012-02-18 02:26
    I finally hit a brick wall. I'm trying to figure out how to decode the propeller font from ram. So far I have
    PUB PropFont_WriteCr(Character) | characterpointer, odd_even, bitpatern[127], idx
    
      odd_even                      := character & $0001
      characterpointer              := character & $fffe
      characterpointer              >>= 1
      characterpointer              *= $80
     
       repeat idx from 0 to 127   
         bitpatern[idx] := long[FONT_ROM_ADDRESS][characterpointer + idx]
    

    Any thoughts?
  • average joeaverage joe Posts: 795
    edited 2012-02-18 03:20
    Now I'm really stuck. I can't find much information on the ROM font. What I'm wondering is how the pixel data is encoded. RTFM about 10 times. From what I can tell, each long contains 2 characters interleaved. From my maths, that tells me each pixel is 4 bits? Not sure what to expect from reading a long of ROM starting @ $8000. I will do some investigating in a while. Can anyone clue me in?
  • kuronekokuroneko Posts: 3,623
    edited 2012-02-18 05:11
    Two characters occupy 32 longs, resolution is 16x32 pixels. Each long holds the first character's data in the even columns/bits and the second character's data in the odd columns/bits, e.g.
    $00: %BABABABA_BABABABA_BABABABA_BABABABA
         ...
    $1F: %BABABABA_BABABABA_BABABABA_BABABABA
    
    Additionally the data is reversed because the video h/w sends the LSBit first. Does that make sense so far?
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-18 05:33
    For the startup I changed it a little
    PUB Start_ILI9325 ' pass orientation true = portrait, false = landscape
        DisplayPins := %00000000_00000000_00000000_00000000 ' store the status of the display pins
        ResetHigh
        wait.pause1ms(5)
        ResetLow
        wait.pause1ms(5)
        ResetHigh
        ChipSelectHigh
        ReadHigh
        WriteHigh
        wait.pause1ms(5)
        ChipSelectLow
              ' ************* Start Initial Sequence **********
        ILIcmd($00E5,$78F0)                          ' set SRAM internal timing
        ILIcmd($0001,$0100)                        ' set SS and SM bit 0001 0100   portrait
        ILIcmd($0002,$0700)                          ' set 1 line inversion 
        ILIcmd($0003,$1030)                        ' set GRAM write direction and BGR=1. $0003 $1030
        ILIcmd($0004,$0000)                          ' Resize register 
        ILIcmd($0008,$0207)                          ' set the back porch and front porch 
        ILIcmd($0009,$0000)                          ' set non-display area refresh cycle ISC[3:0]  
        ILIcmd($000A,$0000)                          ' FMARK function  
        ILIcmd($000C,$0000)                          ' RGB interface setting   
        ILIcmd($000D,$0000)                          ' Frame marker Position   
        ILIcmd($000F,$0000)                          ' RGB interface polarity  
    '        *************Power On sequence ****************//
        ILIcmd($0010,$0000)                         ' SAP, BT[3:0], AP, DSTB, SLP, STB 
        ILIcmd($0011,$0007)                         ' DC1[2:0], DC0[2:0], VC[2:0] 
        ILIcmd($0012,$0000)                         ' VREG1OUT voltage   
        ILIcmd($0013,$0000)                         ' VDV[4:0] for VCOM amplitude  
        ILIcmd($0007,$0001)   
        wait.pause1ms(50)                                   ' Dis-charge capacitor power voltage
        ILIcmd($0010,$1090)                         ' 1490//SAP, BT[3:0], AP, DSTB, SLP, STB   
        ILIcmd($0011,$0227)                         ' DC1[2:0], DC0[2:0], VC[2:0] 
        wait.pause1ms(50)                                   ' delay
        ILIcmd($0012,$001F)                         ' 001C// Internal reference voltage= Vci;
        wait.pause1ms(50)                                   ' delay   
        ILIcmd($0013,$1500)                         ' $1000//1400   Set VDV[4:0] for VCOM amplitude  1A00  
        ILIcmd($0029,$0027)                         ' $0012 //001a  Set VCM[5:0] for VCOMH  //$0025  0034  
        ILIcmd($002B,$000D)                         ' Set Frame Rate   000C       
        wait.pause1ms(50)                                   ' delay   
        ILIcmd($0020,$0000)                         ' GRAM horizontal Address   
        ILIcmd($0021,$0000)                         ' GRAM Vertical Address    
    '         ----------- Adjust the Gamma Curve ----------//
        ILIcmd($0030,$0000) 
        ILIcmd($0031,$0707)  
        ILIcmd($0032,$0307)  
        ILIcmd($0035,$0200)  
        ILIcmd($0036,$0008)  
        ILIcmd($0037,$0004)  
        ILIcmd($0038,$0000)  
        ILIcmd($0039,$0707)  
        ILIcmd($003C,$0002)  
        ILIcmd($003D,$1D04)  
    '        ------------------ Set GRAM area ---------------//
        ILIcmd($0050,$0000)  ' Horizontal GRAM Start Address
        ILIcmd($0051,$00EF)  ' Horizontal GRAM End Address       
        ILIcmd($0052,$0000) ' Vertical GRAM Start Address    
        ILIcmd($0053,$013F) ' Vertical GRAM Start Address       
        ILIcmd($0060,$A700) ' Gate Scan Line     
        ILIcmd($0061,$0001) ' NDL,VLE, REV    
        ILIcmd($006A,$0000) ' set scrolling line      
    '        -------------- Partial Display Control ---------/
        ILIcmd($0080,$0000)
        ILIcmd($0081,$0000)
        ILIcmd($0082,$0000)
        ILIcmd($0083,$0000)
        ILIcmd($0084,$0000)
        ILIcmd($0085,$0000)
    '        //-------------- Panel Control -------------------//
        ILIcmd($0090,$0010)
        ILIcmd($0092,$0600)
        ILIcmd($0007,$0133)  ' 262K color and display ON    
    

    and all the ILIcmd goes through this
    PRI ILIcmd(c,d)  ' instruction in one method
        Lcd_Write_Com(c >> 8,c & 255) ' split a word into two bytes, send command then data
        Lcd_Write_Data(d >> 8,d & 255)
    

    Can you test writing a pixel is working?

    call this draw routine and make x1 = 10, y1=10, x2=10,y2=10
    PUB Draw(x1, y1, x2, y2)       ' sets the pixel to x1,y1 and then fills the next (x2-x1)*(y2-y1) pixels
        ILIcmd($0050,x1)
        ILIcmd($0052,y1)
        ILIcmd($0051,x2)
        ILIcmd($0053,y2)
        ILIcmd($0020,x1) 
        ILIcmd($0021,y1)
        Lcd_Write_Com($00,$22)
    

    Then draw the pixel
    PUB Pixel(pixelcolor)               ' send out a pixel, high byte then low byte
        Lcd_Write_Data(pixelcolor >> 8,pixelcolor & 255)  
    

    and if you make color something like %11111000_00000000 then it should print a red pixel.

    If that works then move on to fonts.

    Attached is the parallax font in 16 point in the format this program can read.
    PUB ILILoadFont(stringptr) | filesize,i                ' read a .ifn file premade in angelcode bmfont and then the vb.net program
        ' pass file name in stringptr
        ' the variable "i" must start on 0,256,512,768 etc for the block move to work
        i := fonttable                                      ' store at the constant 'fonttable' location
        fat.openfile(stringptr,"R")                      ' open an image. Size is in the first long and has been rounded up to the next 256 byte block
        filesize := fat.filesize                            ' read the file size. This file has been rounded up to the next 256 byte block
        repeat (filesize >> 8)                              ' read in this number of 256 byte blocks
          fat.readdata(@sdbuffer,256)                       ' get 256 bytes from sd card  
          ILI9325.docmd("A",@sdbuffer,i,256)      ' A must start on 0,256,512,768 etc move data from hub to external ram 256 bytes at a time    
          i += 256                             ' add 256
        fat.closefile
        FontHeight := ILI9325.readrambyte(fonttable+251)    ' extract font size
        ' extract the background color so can draw the background behind the text
        repeat i from 0 to 2
          sdbuffer[i] := ILI9325.readrambyte(fonttable + 35+i)   ' read the 3 RGB bytes
        ILI9325.docmd("E",@sdbuffer,@buffer2,1)             ' convert to 2 byte .ili format, len is number of pixels        
        BackFontColor := word[@buffer2][0]
        result := filesize    
    
          
    PUB ILIChar(ascii,x,y) | jump,size,width,height,ramaddress,xoffset,yoffset,xadvance   ' read out a character from a .ifn file stored in ram
      ' pass Fonttable = global
        jump := ILI9325.ReadRamLong((ascii << 2) + Fonttable + 256)' jump location = ascii *4 plus fonttable + 256 
        jump += fonttable                                   ' add the fonttable location
        size := ILI9325.ReadRamLong(jump)                   ' size precalculated = width x height x 2
        xadvance :=  ILI9325.ReadRamLong(jump+20)     '     ' amount to move to next character
        if size > 0 and ascii <> 32                                           ' no need to print anything if size is zero or read more font data
          width :=   ILI9325.ReadRamLong(jump+4)                ' width
          height :=  ILI9325.ReadRamLong(jump+8)            ' height
          xoffset := ILI9325.ReadRamLong(jump+12)           ' xoffset to move
          yoffset := ILI9325.ReadRamLong(jump+16)           ' yoffset to move
          if (x+width -1 + xoffset) > screenwidth
            ILIcrlf ' do a new line if it won't fit
            x :=curx
            y :=cury
          ILI9325.draw(x+xoffset,y+yoffset,x+width-1+xoffset,y+height-1+yoffset)      ' draw on screen
          ILI9325.docmd("C",0,jump+32,size)              ' move bytes from ram out to the display  
        return x + xadvance
    

    however, you will have to modify that because it won't fit in hub ram. So instead of reading it into external ram first, open the file each time for each character.

    Maybe start with the SD driver and read in just one byte. You have to have some sort of debugging to get this working. The standard propeller way to debug is to include a serial port object, then when you compile and download, open up the serial port debugging object.

    If you can open the font file, read just one byte, and send that byte (hex format if you like) back to the propeller serial terminal, then it will be possible to debug things along the way.
  • average joeaverage joe Posts: 795
    edited 2012-02-18 07:01
    Thanks kuroneko, I finally got it figured out.
    DR.A, I will have to look at your code later.
    What I have so far is REALLY rough. I will post is sections for clarity.
    CON
      _clkmode      = xtal1 + pll16x                        ' use crystal x 16
      _xinfreq      = 5_000_000
    
      ''PINS FOR LCD
      RS                            = 16
      LCD_WR                        = 17
      LCD_RST                       = 23
      
      ''PINS FOR CS - TO KEEP FROM FLOATING
      SD_CS                         = 22
      TS_CS                         = 21
    
     ''LCD REGISTERS 
      
      REG_OSCILLATOR                = $0000                               ''Oscillator                                (R00h) (POR = 0000h)
      REG_DRIVEROUTPUTCONTROL       = $0001                               ''Driver Output Control                     (R01h) (POR = 2B3Fh)
      REG_LCDDRIVINGWAVFORM         = $0002                               ''LCD-Driving-Waveform Control              (R02h) (POR = 0000h)
      REG_POWERCONTROL1             = $0003                               ''                                          (R03H)
      REG_DISPLAYCONTROL            = $0007                               ''Display Control                           (R07h) (POR = 0000h)
      REG_FRAMECYCLECONTROL         = $000B                               ''Frame Cycle Control                       (R0Bh) (POR = 5308h)D308 BY DATASHEET
      REG_POWERCONTROL2             = $000C                               ''                                          (R0Ch) (POR = 0004)
      REG_POWERCONTROL3             = $000D                               ''                                          
      REG_POWERCONTROL4             = $000E                               ''
      REG_GATESCANPOSITION          = $000F                               ''Gate Scan Position                        (R0Fh) (POR = 0000h)
      REG_SLEEPMODE                 = $0010                               ''Sleep mode                                (R10h) (POR = 0001h)
      REG_ENTRYMODE                 = $0011                               ''Entry Mode                                (R11h) (POR = 6830h)             
      REG_HPORCH                    = $0016                               ''                                          (R16h) (POR = EF1Ch)
      REG_VPORCH                    = $0017                               ''                                          (R17h) (POR = 0003h)
      REG_POWERCONTROL5             = $001E                               ''                                          
      REG_RAMDATAWRITE              = $0022                               ''
      REG_RAMWRITEDATAMASK1         = $0023                               ''                                          (R23h) (POR = 0000h)
      REG_RAMWRITEDATAMASK2         = $0024                               ''                                          (R24h) (POR = 0000h)
      REG_VERTICALSCROLCONTROL1     = $0041                               ''                                          (R41h) (POR = 0000h)
      REG_VERTICALSCROLCONTROL2     = $0042                               ''                                          (R42h) (POR = 0000h)
      REG_HORIZONTALRAMADDRESSPOS   = $0044                               ''                                          (R44h) (POR = EF00h)
      REG_VERTICALRAMADDRESSSTART   = $0045                               ''                                          (R45h) (POR = 0000h)
      REG_VERTICALRAMADDRESSEND     = $0046                               ''                                          (R46h) (POR = 013Fh)
      REG_FIRSTWINDOWSTART          = $0048                               ''                                          (R48h) (POR = 0000h)
      REG_FIRSTWINDOWEND            = $0049                               ''                                          (R49h) (POR = 013Fh)
      REG_SECONDWINDOWSTART         = $004A                               ''                                          (R4Ah) (POR = 0000h)
      REG_SECONDWINDOWEND           = $004B                               ''                                          (R4Bh) (POR = 013Fh)
      REG_SETGDDRXADDRESSCOUNTER    = $004E                               ''                                          (R4Eh) (POR = 0000h)
      REG_SETGDDRYADDRESSCOUNTER    = $004F                               ''                                          (R4Fh) (POR = 0000h)
    
      FONT_ROM_ADDRESS              = $8000
      BGCOLOR                       = $ffff
      TXTCOLOR                      = $0000
    
    This sets the clock and defines the pins used. Then defines the LCD registers, so we can work with them a bit easier. Makes changing controllers easier hopefully. Finally, the start address for the rom font and the Background and Text colors.
    OBJ  
        wait    : "timing"                                    ' thanks to parallax   
        pst     : "Parallax Serial Terminal"    
    
    PUB Bootstrap
        OUTA[SD_CS] := 1                                    ''disableSD
        DIRA[SD_CS] := 1 
        OUTA[TS_CS] := 1                                    ''and touchscreen
        DIRA[TS_CS] := 1
    
         Init_SSD1289
         PST_Init 
         Repeat
          Test_Main
    
    PUB Init_SSD1289                                      ''init pins
                                        ''disableTS
        EnableDisplayPins                                   ''enable pins 0 to 15
        ResetHigh                                           ''reset screen
        wait.pause1ms(5)
        ResetLow
        wait.pause1ms(5)
        ResetHigh
        WriteHigh
        wait.pause1ms(5)                    ''then init screen
    
        Lcd_Write_Com (REG_DISPLAYCONTROL)                  ''Display Control (R07h) (POR = 0000h) 
        Lcd_Write_Data($0021)                               ''GON = 1 DTE = 0 D[1:0] = 01 
        Lcd_Write_Com (REG_OSCILLATOR)                      ''Oscillator (R00h) (POR = 0000h)
        Lcd_Write_Data($0001)                              ''
        Lcd_Write_Com (REG_DISPLAYCONTROL)                  ''Display Control (R07h) (POR = 0000h)
        Lcd_Write_Data($0023)                             ''GON = 1 DTE = 0 D[1:0] = 11
        Lcd_Write_Com (REG_SLEEPMODE)                       ''Sleep mode (R10h) (POR = 0001h)
        Lcd_Write_Data($0000)     ''                      ''         
        Lcd_Write_Com (REG_DISPLAYCONTROL)                  ''Display Control (R07h) (POR = 0000h)
        Lcd_Write_Data($0033)                             ''GON = 1 DTE = 1 D[1:0] = 11
        Lcd_Write_Com (REG_ENTRYMODE)                       ''Entry Mode (R11h) (POR = 6830h)
        Lcd_Write_Data($6830)                             ''
        Lcd_Write_Com (REG_LCDDRIVINGWAVFORM)               ''LCD-Driving-Waveform Control (R02h) (POR = 0000h)
        Lcd_Write_Data($1000)     ''                      ''
        Lcd_Write_Com (REG_GATESCANPOSITION)                ''Gate Scan Position (R0Fh) (POR = 0000h)
        Lcd_Write_Data($0000)     ''                      ''                                                        ''
        Lcd_Write_Com (REG_DRIVEROUTPUTCONTROL)             ''Driver Output Control (R01h) (POR = [0XXXX0X1]3Fh)  2b3f
        Lcd_Write_Data($6b3F)     ''                      ''
        Lcd_Write_Com (REG_FRAMECYCLECONTROL)               ''Frame Cycle Control (R0Bh) (POR = 5308h)
        Lcd_Write_Data($5308)                               ''                           '
        Lcd_Write_Com (REG_DISPLAYCONTROL)                  ''Display Control (R07h) (POR = 0000h)
        Lcd_Write_Data($003B)                               ''GON = 1 DTE = 1 D[1:0] = 11  CM = 1 65K COLOR
    
    PUB PST_Init  | PstCog
    PstCog := (pst.Start(115200) -1)
    pst.Str(String("Parallax Serial Terminal started in cog "))
    pst.Dec(PstCog)
    pst.Newline  
    wait.pause1s(1)
    
    
    This is the basic boot-loader. Should be self-explanatory. The next section is where all the heavy lifting gets done.
    PUB Test_Main | char, row, col
    
        pst.Clear
    
        pst.Str(String("Select character"))
        pst.newline
        char := pst.DecIn
    
        pst.Str(String("Select Row"))
        pst.newline
        row := pst.DecIn
            
        pst.Str(String("Select Col"))
        pst.newline
        col := pst.DecIn
        
         PropFont_WriteCr(char, row, col,  BGCOLOR, TXTCOLOR)
         return
    
    return
    
    PUB PropFont_WriteCr(Character, PosR, PosC, BgC, TxC) | characterpointer, odd_even, bitpatern[32], idx, pxlidx, lcdidx, pxlidxdcd 
    
      odd_even                      := character & $0001
      characterpointer              := character & $fffe
      characterpointer              >>= 1
      characterpointer              *= 32
    
      
       repeat idx from 0 to 31   
         bitpatern[idx] := long[FONT_ROM_ADDRESS][characterpointer + idx]
    
       repeat idx from 0 to 31
            
         repeat pxlidx from odd_even to odd_even + 30  step 2 
           pxlidxdcd := |< pxlidx   
    
           Lcd_Write_Com (REG_SETGDDRxADDRESSCOUNTER)
           Lcd_Write_Data(idx + (PosR * 32))
           Lcd_Write_Com (REG_SETGDDRyADDRESSCOUNTER)
           Lcd_Write_Data((pxlidx/2) + (PosC * 16))        
    
           if ((bitpatern[idx] & pxlidxdcd) == pxlidxdcd)  
             Lcd_Write_Com(REG_RAMDATAWRITE)
             Lcd_Write_Data(TxC)
           else
             Lcd_Write_Com(REG_RAMDATAWRITE)
             Lcd_Write_Data(BgC)
    PRI LCD_Writ_Bus(V) 
        OUTA[15..0]  := V
        
        WriteLow                                            ' write pin low
        WriteHigh                                           ' toggle write pin
    
    PRI Lcd_Write_Com(V)
        RSLow
        LCD_Writ_Bus(V)
    
    PRI Lcd_Write_Data(V)
        RSHigh
        LCD_Writ_Bus(V)    
    
    PRI EnableDisplayPins
        DIRA:=%00000000_11100011_11111111_11111111 ' , Reset, WR, RS and 16 data lines active    
    
    PRI TristateDisplayPins ' tristate all pins - 
        DIRA:=%00000000_11100010_00000000_00000000    ''CS pins need to be cleared to access devices
    
    PRI RSLow                                    ' RS pin
     outa[RS] := 0                  
    
    PRI RSHigh
     outa[RS] := 1                 '
    
    PRI WriteLow                                    
        outa[LCD_WR] := 0                             ' 
    
    PRI WriteHigh
        outa[LCD_WR] := 1 
    
    PRI ResetLow                                    
        outa[LCD_RST] := 0                        ' 
    
    PRI ResetHigh
        outa[LCD_RST] := 1  
    

    So far things seem to be working. I can display characters by selecting a character code in PST. Just finishing up a clear screen. I'm trying to figure out how to rotate the screen from registers. I've played with it a bit, but the only way I could get it working was by using pointer offset indexes every write. This slows things down a ton right now. I will be posting video in a bit. I'm still trying to get the basics of the screen down. Once I feel comfortable with that, I need to figure out Sd card and touch. I still need to draw the schematic for the final hardware. The entire system will use SPI as I have one analog board with 2-spi devices, and another board with at least one spi device. I plan on setting up a locking system with FIFO for spi and possibly parallel. I still want to be able to use the pins 0-16 later down the road. I think it would give a bit of flexibility to the system. Everything is in spin so far, that WILL change. Back to work ;)
  • average joeaverage joe Posts: 795
    edited 2012-02-18 09:19
    I have run more tests and decided I need PASM drivers for this. Spin works, but sequential screen draw is about 12 seconds.. I have no idea what random draw is. Probably pretty bad.
    youtube video up
    http://youtu.be/WDaUkp8kw4Q
  • average joeaverage joe Posts: 795
    edited 2012-02-18 11:35
    Been working on the heavy lifters.. i'm thinking something like
    PUB PropFont_WriteCr(Character, PosR, PosC, RBorder, CBorder, BgC, TxC) | characterpointer, odd_even, bitpatern[32], idx, pxlidx, lcdidx, pxlidxdcd, x1, y1, x2, y2
    
      odd_even                      := character & $0001
      characterpointer              := character & $fffe
      characterpointer              >>= 1
      characterpointer              *= 32
       repeat idx from 0 to 31 
         bitpatern[idx] := long[FONT_ROM_ADDRESS][characterpointer + idx]
    
         
      y1 :=  PosC + CBorder 
      y2 := (PosC + 15) - CBorder
      x1 :=  PosR + RBorder
      x2 := (PosR + 31) - RBorder
         
         SetWindow(x1, y1, x2, y2)
         SetGAddress(x1,y1)
      repeat idx from RBorder to 31 - RBorder
            
         repeat pxlidx from odd_even + (CBorder*2) to (odd_even + 30) - (CBorder*2) step 2
           pxlidxdcd := |< pxlidx   
           if ((bitpatern[idx] & pxlidxdcd) == pxlidxdcd)  
             Lcd_Write_Com(REG_RAMDATAWRITE)
             Lcd_Write_Data(TxC)
           else
             Lcd_Write_Com(REG_RAMDATAWRITE)
             Lcd_Write_Data(BgC)
    
     SetWindow(0, 0, 240, 320)
     
    return        
    
    
    PUB SetWindow(x1, y1, x2, y2) | HORIZONTALRAMADDRESSPOS
    
     WindowX1 := x1
     WindowX2 := x2
     WindowY1 := y1
     WindowY2 := y2
     
        HORIZONTALRAMADDRESSPOS := x1 + (x2 << 8)
                 
           Lcd_Write_Com ( REG_HORIZONTALRAMADDRESSPOS)
           Lcd_Write_Data(HORIZONTALRAMADDRESSPOS)
           
           Lcd_Write_Com (REG_VERTICALRAMADDRESSSTART)
           Lcd_Write_Data(y1)
           Lcd_Write_Com (REG_VERTICALRAMADDRESSEND)
           Lcd_Write_Data(y2)
    
    PUB SetGAddress(x,y)
           Lcd_Write_Com (REG_SETGDDRxADDRESSCOUNTER) ''max %1111_1111, $FF
           Lcd_Write_Data(x)
           Lcd_Write_Com (REG_SETGDDRyADDRESSCOUNTER) ''max %1_0011_1111, $13f
           Lcd_Write_Data(y)
    return
    
    I want to get something I'm happy with in spin before I implement the Pasm. With the RBorder and CBorder, things are coming together. I need to figure out transparent text writing now.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-18 18:29
    I've coded up a super simple demonstration - see attached.

    * One font
    * No external ram needed
    * No graphics, just text
    * Font data sent out in pasm so faster than spin.

    Prints white on blue on a 40x15 text-only mode. Very useful for debugging.

    Font is loaded into hub so not much room left (1364 longs free).

    Put the font par16.ifn on the sd card. (standard parallax font 8x16)

    You will need to change the pins for the actual data output but I think you already have this working.

    Have you got a single pixel on the screen yet? (I found getting a single pixel was the hardest bit)
    640 x 480 - 48K
  • average joeaverage joe Posts: 795
    edited 2012-02-19 02:14
    Dr_Acula wrote: »
    Have you got a single pixel on the screen yet? (I found getting a single pixel was the hardest bit)

    Sorry if I've been obscure. I have pixels on screen. I can draw font by calling PropFont_WriteCr . I have broken this a few times trying to add borders. I think borders is an easy way to make graphics out of the prop's ROM font. Things are a bit slow to write due to being written in spin.

    I looked at your demo, very nice. You and your progress have been a huge help to me. I hope you noticed the PRI methods are almost your methods. I think I could write in compatibility for other fonts later.

    The goal for me now is getting propFontWrite perfected in spin. I need to implement an abstract data array in DAT blocks for menus. AN003 anyone? I have not even tested SPI, but see no reason it won't work. I need to do some digging on this still, since I will have some strong requirements from the spi bus.

    Getting pixels out is the easy part, I found. Making sure they were the right pixels, going to the right place is what I'm struggling with. I NEED to be RGB565 compatible, but I seem to have registers set wrong. If I am correct, $FFFF should be white?
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-19 02:59
    Great news!

    Ok, a few things. First, I see a few places in your code with lines like
    SetWindow(0, 0, 240, 320)
    

    Just watch that sort of thing because it gets me all the time. The screen is 240 bytes wide, so if you run a loop from 0 to 240 you get 241 iterations, not 240. So just check and recheck that if a number starts from zero, it ends with finish-1, not finish.

    The display is forgiving - if you try to write stuff off the end of the range it still prints things but not in the right place.

    The prop font is a fixed width font, like Courier New. So I cheated in that last code and made it 8x16. But the code can handle variable width fonts too and sooner or later you might want to add Times Roman and Arial. The BMFont program is really nifty as it exports all this information, including the height, width of a character as well as the xoffset to add for the next character. There is even a list of Kerning data for character pairs - I don't use this, but it could make fonts look even better.

    I'm still learning about this display. It seems happiest sending out blocks of data. It seems very inefficient sending out pixels because the overhead of telling the display where the pixel is to be is more bytes than the actual pixel data. So if you can only send out blocks of data, I figured that things like sending out fonts one pixel at a time are not going to work so well.

    So the display seems to lead you towards setting up a font as a data stream, and then send out that data stream. For the propeller font it is 8x16=128 bytes and you just dump those bytes out mindlessly.

    One thing I do need to code is the draw routine that sends out the x1 y1 x1 y2 data for the block. That ought to be in pasm, not spin.
    If I am correct, $FFFF should be white?

    Yes correct, and $0000 is black. I started there. Very useful for debugging.
    I NEED to be RGB565 compatible, but I seem to have registers set wrong.

    Check in the code for some answers to this. I have some code in pasm that turns a block of data from 3 byte RGB into 2 byte RRRRRGGG GGGBBBBB data. You can send just one pixel if you want
        repeat i from 0 to 2
          sdbuffer[i] := ILI9325.readrambyte(fonttable + 35+i)   ' read the 3 RGB bytes
        ILI9325.docmd("E",@sdbuffer,@buffer2,1)             ' convert to 2 byte .ili format, len is number of pixels        
    

    where that "1" at the end of the command says "do just one pixel"

    Not the most efficient way but there are situations where this could be useful.

    Re
    The goal for me now is getting propFontWrite perfected in spin. I need to implement an abstract data array in DAT blocks for menus. AN003 anyone? I have not even tested SPI, but see no reason it won't work. I need to do some digging on this still, since I will have some strong requirements from the spi bus.

    Can you please explain that a bit more, what are you wanting to do?
  • average joeaverage joe Posts: 795
    edited 2012-02-19 03:45
    Well, the FINAL version of this code development SHOULD be able to provide a good jumping off place for direct pin connection with these types of screens. I just finished up a schematic for the new hardware revision. Not much of a change except implementing a 139 for addressing. This will allow for 1 external SPI channel and 3 external 16 bit parallel channels. 2 spare pins? Might implement these as DACs for audio out? Maybe Midi I/O? I've seen a few people interested in direct pin connection and wonder what kind of external i/o options they would like.

    The display is VERY slow doing random pixel writes. That's why I think setwindow could be really handy for drawing. I saw the set window error after I posted. I will fix this soon. The reason I asked about the hex code for white is because my display is currently inverted. Last time I tried playing with the registers for this, I broke all kinds of things. I think the constant blocks could use some work to make setting discrete values easier. This would also make porting the code to other display controllers easier too, I think. Portability is my main focus right now.

    My reference to AN003 is because they have some good jumping off points for indexed arrays and other handy stuff.

    What I want to do with what I'm working on now is, implement a simple GUI based on the ROMfont. I think propFontWrite is close, but could still use offsets for Row border and Column border. What I have now is this.
     PUB PropFont_WriteCr(Character, PosR, PosC, RBorder, CBorder, BgC, TxC) | characterpointer, odd_even, bitpatern[32], idx, pxlidx, lcdidx, pxlidxdcd, x1, y1, x2, y2
    
      odd_even                      := character & $0001
      characterpointer              := character & $fffe
      characterpointer              >>= 1
      characterpointer              *= 32
       repeat idx from 0 to 31 
         bitpatern[idx] := long[FONT_ROM_ADDRESS][characterpointer + idx]
    
         
      y1 :=  PosC + CBorder 
      y2 := (PosC + 15) - CBorder
      x1 :=  PosR + RBorder
      x2 := (PosR + 31) - RBorder
         
         SetWindow(x1, y1, x2, y2)
         SetGAddress(x1,y1)
      repeat idx from RBorder to 31 - RBorder
            
         repeat pxlidx from odd_even + (CBorder*2) to (odd_even + 30) - (CBorder*2) step 2
           pxlidxdcd := |< pxlidx   
           if ((bitpatern[idx] & pxlidxdcd) == pxlidxdcd)  
             Lcd_Write_Com(REG_RAMDATAWRITE)
             Lcd_Write_Data(TxC)
           else
             Lcd_Write_Com(REG_RAMDATAWRITE)
             Lcd_Write_Data(BgC)
    
     SetWindow(0, 0, 239, 319)
     
    return 
    

    All it takes is a
    PropFont_WriteCr(72, 0, 0*16, 0, 0, BGCOLOR, TXTCOLOR)

    To kick out a letter. I need to look more into graphics and tv modules to try and find compatibility. I think I'm off to a good start, other than colors being inverse. I would like to have sd and touch working before I release the full source.

    I would like to get other fonts working soon, but I will probably need some emm for that. Have I mentioned yet that I'm in WAY over my head, LOL!
    Thanks again for your help. It would have taken me forever to get this far without it.
    BTW, I have not tried your demo yet. I will fix color inversion and then I will check it out. I'm interested to see how it ports across. ;)
  • average joeaverage joe Posts: 795
    edited 2012-02-19 09:08
    What's wrong with this code?
    PUB Init_SD
    
      pst.Str(string("Testing for SD card"))        ' helpful message if card is out, better than just a blank screen 
      pst.newline       
        ifnot( fat.FATEngineStart(_SD_DO, _SD_CLK,_SD_DI, _SD_CS, _SD_WP, _SD_CD, -1, -1, -1))   
          pst.str(string("fail"))
       pst.newline   
       pst.str(string("GOOD))
       pst.newline
       pst.str(string("mounting fat"))
       pst.newline   
        fat.mountPartition(0)                               ' mount the sd card
        pst.str(string("mounting fat done"))
        pst.newline
    
    

    I get
    Testing for sd card, good, mounting fat, then nothing. It doesn't matter if I have a card in or not.
  • average joeaverage joe Posts: 795
    edited 2012-02-19 10:52
    After more thought, I realized its probably hardware related. The datsheet shows 10k resistors across cs, di and ck. Actual values are 202. or 2k. Would "removing" these resistors help?
    Tried getting info out of the touchscreen, nothing yet. Seems to just lock up. idk..

    I got the touchscreen going. That was way too easy. Still nothing with the sd card. I'm not sure what I'm doing wrong. I "bypassed" the resistors. Not sure what to do now.
  • average joeaverage joe Posts: 795
    edited 2012-02-19 12:19
    I fixed the hardware, and still get nothing. I tried using fatengine, but it returns -1 no matter what. I'm stumped..
    pst.dec(fat.FATEngineStart(_SD_DO, _SD_CLK,_SD_DI, _SD_CS, _SD_WP, _SD_CD, -1, -1, -1))
    

    ok, dead prop? or am I a complete retard?

    CON
      _clkmode      = xtal1 + pll16x                        ' use crystal x 16
      _xinfreq      = 5_000_000
    
    var
    long stack
    
    PUB Start
     coginit(7, EnableDisplayPins, @stack)
     
    PUB EnableDisplayPins
        DIRA:=%00000011_11111111_11111111_11111111
        OUTA:=%00000011_11111111_11111111_11111111
    
    
    SHOULD make pins high, but does nothing?? tried launching in all cogs. Did my prop die and I not know it?
    Still working on it
          pst.dec(fat.FATEngineStart(_SD_DO,_SD_CLK,_SD_DI,_SD_CS,-1, 1, 1, 1,-1))
    
    outputs -1 no matter what I do.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-19 14:44
    I got the touchscreen going. That was way too easy. Still nothing with the sd card. I'm not sure what I'm doing wrong. I "bypassed" the resistors. Not sure what to do now.

    I haven't managed to get the SD card working on the actual display - I'm using my own socket. It is either that the resistors are not correct or maybe some pins are not correct on the schematic.

    It would simplify things to use the SD socket on these displays. When I get home I might get out the multimeter and actually check what pins go where.

    Addit: Looking at the photo at the bottom of this ebay post http://www.ebay.com.au/itm/2-4-TFT-LCD-Module-Display-Touch-Panel-PCB-adapter-/190477028273?pt=LH_DefaultDomain_0&hash=item2c5950cbb1 it appears the resistors are in series with the lines. The standard connection to the propeller chip has no series resistors and it has 10k pullups on CS DO DI and CLK. So I wonder if adding pullups and bypassing the resistors is the secret?
  • average joeaverage joe Posts: 795
    edited 2012-02-19 16:24
    Dr_Acula wrote: »
    I haven't managed to get the SD card working on the actual display - I'm using my own socket. It is either that the resistors are not correct or maybe some pins are not correct on the schematic.

    It would simplify things to use the SD socket on these displays. When I get home I might get out the multimeter and actually check what pins go where.

    Addit: Looking at the photo at the bottom of this ebay post http://www.ebay.com.au/itm/2-4-TFT-LCD-Module-Display-Touch-Panel-PCB-adapter-/190477028273?pt=LH_DefaultDomain_0&hash=item2c5950cbb1 it appears the resistors are in series with the lines. The standard connection to the propeller chip has no series resistors and it has 10k pullups on CS DO DI and CLK. So I wonder if adding pullups and bypassing the resistors is the secret?

    Well I have already tried bypassing the resistors. That didn't help. I then inspected the board closer and found vias on the driven lines (cs,di,ck) I couldn't find anything about them on the schematic. SO, I tried cutting the traces to remove the vias. I then bypassed these with some wires from a ribbon cable. Still nothing. So I'm scratching my head. If I can't use the sd card, I won't be able to develop with sd for a while. Ask the IRS how long, because I don't know. LOL I checked with the multimeter and could not find any faults. This really sucks because without an sd card, I'm going to get stuck real quick.

    I also tried adding pullup resistors to di, do, cs, ck and nothing.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-19 16:37
    I've been looking at photos of various boards. The schematic seems ok. I presume you have the 10k pullups? (I suspect DO doesn't need one.)

    The other thing that might be worth doing is putting some bypass caps across the supply pins right at the SD card. Maybe a 10 to 33uF tantalum and a 0.1uf ceramic.

    I need to do some more experiments.
  • average joeaverage joe Posts: 795
    edited 2012-02-19 16:47
    Dr_Acula wrote: »
    I've been looking at photos of various boards. The schematic seems ok. I presume you have the 10k pullups? (I suspect DO doesn't need one.)

    The other thing that might be worth doing is putting some bypass caps across the supply pins right at the SD card. Maybe a 10 to 33uF tantalum and a 0.1uf ceramic.

    I need to do some more experiments.

    I would imagine Do doesn't need a pullup, but...
    The resistors don't seem to make a difference. I MUST be doing something wrong. I will check my trace removal and re-wire in a bit. Bypassing might be the issue? Not sure what else it could be.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-19 16:59
    Looking at the boards there doesn't seem to be much in the way of capacitors. They have a 5V to 3V regulator on board. I read somewhere that an SD card can take a peak of 200mA at times, though most of the time it is using hardly anything. It can't hurt to add more capacitors across the power supply pins on the SD card.
  • average joeaverage joe Posts: 795
    edited 2012-02-20 03:11
    I didn't have any Tants laying around so I tried a 10uf EL in parallel with a .1 Ceramic. No change :( So I'm ordering a breakout board right now.

    edit,
    Just ordered http://microcontrollershop.com/product_info.php?products_id=3460
    hope this solves my problems.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-20 05:10
    Yes there is something very strange going on here. The SD socket on my board doesn't work either. I have my own SD socket on the same stack of boards and that works fine. Continuity tests seem ok. The resistors in series are 2k and the standard propeller circuit does not have these so I need to try shorting out those three surface mount resistors. Also I have two displays and I have tried both and no change with either.

    I think those resistors are there for voltage level translation. The board is designed to talk to a 5V micro and the SD card is 3.3V so for 5V => 2k => 3.3V that does the translation.

    But with 3V => 3V those resistors are not needed. However, it shouldn't stop the circuit working.
  • average joeaverage joe Posts: 795
    edited 2012-02-20 06:17
    I'm puzzled. I hope you can get your board working because then I know I'm doing something wrong. I tested pins 3 times and everything is right. I tested 2M setting across all other pins and it looked good but still doesn't work. Even with the caps.. I've given up for now and ordered an micro sd card breakout. It might come in handy to have both working later. I made the first revision in hardware and am currently updating code to reflect changes. I have 1/2 of a 139 to decode sd cs, touch cs, lcd reset and an external. I'm not sure how this will affect the fat drivers since I couldn't get them running to begin with.


    New control commands are formatted as such
    PUB Enable_SDC
      OUTA[DEV_SPI_ADD1..DEV_SPI_ADD0] := DEV_SPI_SDC_CS                       ' 
      OUTA[DEV_SPI_EN] := 1
      
    PUB Disable_SDC
      OUTA[DEV_SPI_ADD1..DEV_SPI_ADD0] := DEV_SPI_SDC_CS                       ' 
      OUTA[DEV_SPI_EN] := 1
      
    PUB Enable_SPI_EXT
      OUTA[DEV_SPI_ADD1..DEV_SPI_ADD0] := DEV_SPI_EXT_CS                              
      OUTA[DEV_SPI_EN] := 0                        ' 
      
    PUB Disable_SPI_EXT
      OUTA[DEV_SPI_ADD1..DEV_SPI_ADD0] := DEV_SPI_EXT_CS                        ' 
      OUTA[DEV_SPI_EN] := 1
      
    '********************** private methods *********************
    
    PRI Enable_Touch
      OUTA[DEV_SPI_ADD1..DEV_SPI_ADD0] := DEV_SPI_TSC_CS                              
      OUTA[DEV_SPI_EN] := 0                        ' 
      
    PRI Disable_Touch
      OUTA[DEV_SPI_ADD1..DEV_SPI_ADD0] := DEV_SPI_TSC_CS                              
      OUTA[DEV_SPI_EN] := 0                        ' 
    
    PRI LCD_Reset 
        OUTA[DEV_SPI_ADD1..DEV_SPI_ADD0] := DEV_SPI_LCD_RES                              
        outa[DEV_SPI_EN] := 0         
        wait.pause1ms(5)                                  ''wait here if necessary                           ' 
        outa[DEV_SPI_EN] := 1
        
    PRI LCD_Writ_Bus(V) 
        OUTA[15..0]  := V
        WriteLow                                            ' write pin low
        WriteHigh                                           ' toggle write pin
    
    PRI Lcd_Write_Com(V)
        RSLow
        LCD_Writ_Bus(V)
    
    PRI Lcd_Write_Data(V)
        RSHigh
        LCD_Writ_Bus(V)    
    
    PRI EnableDisplayPins
        DIRA:=%00000000_11100011_11111111_11111111 ' , Reset, WR, RS and 16 data lines active    
    
    PRI TristateDisplayPins ' tristate all pins -                                                 
        DIRA:=%00000000_11100010_00000000_00000000 ''
    
    PRI RSLow                                    
        outa[RS] := 0
    PRI RSHigh
        outa[RS] := 1                 '
    PRI WriteLow                                    
        outa[LCD_WR] := 0                             ' 
    PRI WriteHigh
        outa[LCD_WR] := 1 
    


    I just made a schematic for my external spi bus idea. The only problem is it uses 1 line more than I JUST built the hardware for. I guess I need to use another pin...

    I have some ideas how to make this play nice with the fat driver when i get it working, I just need to look into the fat driver itself a bit more. I'm thinking I can use the locking system to control the SPI bus access system. Still trying to figure out how to make the hardware cascading work the way I want it.

    bus_controller.png
    LCD rev2.jpg
    962 x 490 - 14K
    1024 x 649 - 79K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-20 14:06
    I won't be able to get to a soldering iron for another 36 hours, but then I can do some proper testing. It is strange that with two sockets wired the same, and in parallel, one works and one does not. The differences are
    1) the 2k series resistors
    2) lack of decoupling right at the sd socket
    3) The lcd display is running on a local 3V regulator with minimal capacitance on it
    4) ?? physical connections inside the SD socket

    Of course, the SD card goes upside down with respect to the display.

    So a few things to test out and experiment with.
    The only problem is it uses 1 line more than I JUST built the hardware for. I guess I need to use another pin...

    or use a 138 instead of a 139?
  • average joeaverage joe Posts: 795
    edited 2012-02-20 16:35
    Dr_Acula wrote: »

    or use a 138 instead of a 139?
    I thought of that after I got done building the board. Everything seems to work, with the exception of the sd card. I will upload photos later. I can't wait to get the sd card breakout because I have given up on getting the one on the board to work. I tried everything I could think of and everything you suggested. Hopefully you'll have better luck.
    Right now I've been trying to get my analog board working. I finished the serial interface and everything seems to test ok. But it doesn't seem to work. More debugging to do. I have way more cascading outputs than I need but I'm sure those will come in handy. For lack of a better mounting solution, the display is taped to the propRPM. It's not pretty but it works.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-20 16:42
    Which analog circuit are you building?

    Re the 139 (and also the 138) - you might need a pullup on the enable pin. When the propeller boots up all the pins are HiZ and so the state of the 139 outputs will be unknown (and probably oscillating all over the place from stray RF). If you put a 10k pullup on the enable pin of the 139 then the outputs of the 139 will be guaranteed to be all high.
  • average joeaverage joe Posts: 795
    edited 2012-02-20 17:27
    The circuit is from a different post here ----> http://forums.parallax.com/showthread.php?114720-Audio-Design&p=1065485#post1065485Post #24 has the most recent schematic. I changed the output to what is used is Post 29. A bit complicated and confusing. The actual prototype worked with the BS2.

    I am trying to get the spi bus interface working *this thread, post 24, first schematic* First mistake I found, the 174 has a floating clear. I will tie to 5v and try again.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2012-02-20 18:47
    Sorry to but in on this thread, but...is this the same screen found here : http://iteadstudio.com/store/index.php?main_page=product_info&cPath=57_58&products_id=55

    If so, I am also hoping to get the SD card to work for my product. If I can't get the SD card working, it may be useless to me :(
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-20 19:01
    If so, I am also hoping to get the SD card to work for my product. If I can't get the SD card working, it may be useless to me

    Yes that is the same one. We will get it working. There are only so many places this hardware bug can hide. I'm going to start by unsoldering every pin on the sd socket and wiring them in parallel to the socket I know works. Then if that doesn't work, it is the socket. If it does, add back in parts of the original circuit till it fails.
  • TylerSkylerTylerSkyler Posts: 72
    edited 2012-02-20 19:07
    Your Right Dr. A the first pixel seems to be the hardest(and I haven't even got one pixel yet).


    Joe, I have looked at your first demo(ssm1289) and have hooked up the DB0-15 and All other lines properly(I have double and triple checked), but stil when I compile and Run I get nothing no life. I know this isn't much to go off, but if there is any advice or help you can provide that would be most useful.

    Thanks,

    Tyler
Sign In or Register to comment.