Re: [bascom] HDSP2112/2115 intelegent displays from old cell phones.


From "David Fahey" <nzkiwi@nc.rr.com>
Date Thu, 5 Feb 2004 22:32:30 -0500

Hi Jeff,

  This display is simila to the PD2437 that I once managed to
aquire a few. Here is the BASCOM-AVR code that I used to drive
the display. You may find it some use. (the circuit diagram in the
comments should format OK if you view it with a fixed font).

Regards,  Dave Fahey

'///////////////////////////////////////////////////////////////////////////
////
'// Project:   pd2437
'// Program:   pd2437str2.bas
'// Language:  Basic - Bascom-AVR ver 1.11.7.1
'// Support:   David Fahey
'// Date:      15Feb2003
'// Purpose:   To control the pd2437 4 char green ascii display.
'//
'// History:   15Feb2003  Initial coding                              DAF
'//            21Feb2003  Finally made it work                        DAF
'//
'// Notes:     The device PD2437 has a nasty default brightness of
'//            &b......00 which is 0% bright (not bright==dark) so this
'//            code sets the bits in the attribute register first
'//            to &b00001111 (full bright)
'//
'//            The data must be loaded in address order 0,1,2,3
'//            which is right to left on the display. If this is
'//            not done addr4 often gets the data fo addr2 - weird.
'//
'//            Address must be set on pins before data is written.
'//            Data is then written by strobing the /WR line from
'//            high to low.
'//
'//            The high order bit of the data determines if the
'//            currently addressed character register should use the most
'//            recently set value in the attribute register. If the
'//            high order bit is 1 then the attribute register is copied
'//            to the addressed characters local attribute register
'//            (which is specific to the addressed character).
'//
'//            Circuit between AVR and PD2437
'//
'//   vcc                 +------------------------------------------+
vcc
'//    |                  |       CD4094                             |
|
'//    |  +--------+      |      +------+         +-----------+      |
|
'//    |  |        |      +--OE--|15   4|-q1--d0--|19        1|-/RD--|
|
'//    ---|5       |             |     5|-q2--d1--|18         |      |
|
'//       |       1|--b0----STR--|1    6|-q3--d2--|17        3|-/cks-|
|
'//       |        |             |     7|-q4--d3--|16         |      |  4k7
|
'//       |       2|--b1---DATA--|2   14|-q5--d4--|15
4|-/rst-+-/\/\/\--|
'//       |        |             |    13|-q6--d5--|14         |      |
'//       |       3|--b2----CLK--|3   12|-q7--d6--|13        5|-CE---+
'//       |        |             |    11|-q8--d7--|12         |
'//       |        |             |      |         |           |
'//       |        |        vdd--|16   8|--Gnd    |           |
'//       |        |             +------+         |           |
'//       | Tiny26 |                              |  PD2437   |
'//       |        |                              |           |
'//       |       4|--b3---------------------/WR--|11         |
'//       |        |                              |           |
'//       |       9|--b6----------------------a2--|7          |
'//       |       8|--b5----------------------a1--|8          |
'//       |       7|--b4----------------------a0--|9          |
'//       |        |                              |           |
'//       |        |                              |           |
'//       |        |                        -/ce0-|6          |
'//    ---|6       |                        |     |           |
'//    |  |        |                        |-----|10         |
'//    |  +--------+                        |     +-----------+
'//    |                                    |
'//   Gnd                                   Gnd
'//
'//
'// End.
'///////////////////////////////////////////////////////////////////////////
////

$regfile = "at26def.dat"
$crystal = 1000000
'use byte library for smaller code
$lib "mcsbyte.lbx"

'reserve space for variables
dim q as byte
dim v as byte
dim s as string * 5

'use port A and B for output
config portb = output

declare sub disp(inpstr as string)

'main - print out all chars >= space
  do
    for q = 32 to 127
      v = q
      mid(s,1,1) = v
      incr v
      mid(s,2,1) = v
      incr v
      mid(s,3,1) = v
      incr v
      mid(s,4,1) = v
      call disp(s)
      waitms 250
    next q
  loop

end

sub disp(inpstr as string)
  cd4094str  alias portb.0
  cd4094data alias portb.1
  cd4094clk  alias portb.2
  pd2437wr   alias portb.3
  pd2437a2   alias portb.6
  pd2437a1   alias portb.5
  pd2437a0   alias portb.4

  dim adr as byte
  dim i as byte
  dim j as byte
  dim d as byte
  dim t as string * 5

  '*** firstly set attribute byte in pd2437 ***
  'put data into cd4094 shift register
  set cd4094str            'cd4094 output disable
  d = &b00001111
  shiftout cd4094data,cd4094clk,d,0,8,1
  reset cd4094str           'put data byte out on cd4094 pins
  waitus 1                  'wait
  pd2437a2 = 0              'set pd2437 control register (data bit 1=data
0=ctrl)
  waitus 1                  'wait Trs > 10 ns
  reset pd2437wr            'write data strobe low
  waitus 1                  'wait Tw-Tds 60-20 >= 40 ns
  set pd2437wr              'write data strobe high writes data to pd2437
  waitus 1                  'wait Tw > 60 ns

  '*** send data bytes to pd2437 ***
  adr = 0
  'data must be loaded in in this order or there will be odd
  'errors in the pd2437 device
  for i = 4 to 1 step -1
    'put data into cd4094 shift register
    set cd4094str           'put data byte out on cd4094 pins
    t = mid(inpstr,i,1)     'get char from string
    d = asc(t)              'convert to byte
    shiftout cd4094data,cd4094clk,d,0,8,1
    reset cd4094str          'cd4094 output disable
    'put display addr out on pins
    adr = 4 - i              'determine address in pd2437
    pd2437a0 = adr.0         'place adr on pa2437 address port
    pd2437a1 = adr.1         'place adr on pa2437 address port
    pd2437a2 = 1             'data bit 1=data 0=ctrl
    waitus 1                'wait Trs > 10 ns
    reset pd2437wr          'write data strobe low
    waitus 1                'wait Tw-Tds 60-20 >= 40 ns
    set pd2437wr            'write data strobe high
    waitus 1                'wait Tw > 60 ns
  next i
end sub



----- Original Message -----
From: "Jeff Pethybridge" <j.pethybridge@latrobe.edu.au>
To: <bascom@grote.net>
Sent: Thursday, February 05, 2004 1:07 AM
Subject: [bascom] HDSP2112/2115 intelegent displays from old cell phones.


> There was some talk of VF displays a week or two ago.
> I was given an OLD Motorola Mob Phone ( cell phone)... I just give these
> things to the kids to pull apart..
> Wellll... I just took note of the Intelligent display these things
> have..
>
> The one I have is a 2115s
>
> 5volt..
> 8 of 5x7 CHR...
> 16 programmable CHRs...
>
>
> http://www.rentron.com/Files/hdsp-2112.pdf
>
> I'll collect a few from now on ;-)
>
>
>