PICANLINTEC USB Controller and plugin for VDR

I have purchased a Lintec Senior computer case housing the following hardware and software :

Mainboard ASUS A7N8X-VM400
Processor
AMD Sempron 2400+
DVB
Haupauge DVB-S 1.6
OS
Debian unstable
HTPC
VDR 1.3.37

The Lintec case comes with a front panel LCD display (HD44780 compatible 1*16 chars) and 6 front buttons but without the required controller. I decided to make one of my own based on a Microchip 18F2455 microcontroller with USB interface emulating a serial port.


FEATURES

HARDWARE

Please note that for USB full-speed operation, resistor R18 has to be removed (was meant for low-speed 16C745)

Some other minor modifications like Backlight control through an additionnal transistor shall be described later.

LOW LEVEL SOFTWARE

One can now communicate with the device as symply as echo "hello"> /dev/ttyACM0 or through a terminal like minicum using /dev/ttyACM0 instead of /dev/ttyS0.

Example : echo "hello"> /dev/ttyACM0




Feature
Command
Comment
General purpose output:

switch off (0V) 0xFD 0x10
switch on (5V) 0xFD 0x11



PWM:

switch off (0V) 0xFD 0x20
pwm mode on 0xFD 0x21
fan mode on 0xFD 0x21



fan mode (low frequency and 50% duty cycle ):

cpu fan prescaler 0xFD 0x30 0xYY 0xZZ
--> explanations alter



pwm mode
(fixed frequency xxkHz and variable duty cycle for power control
):


pwm prescaler 0xFD 0x40 0xYY 0xZZ --> explanations alter
pwm duty cycle 0xFD 0x50 0xYY 0xZZ --> explanations alter



BACKLIGHT

switch off (0V) 0xFD 0x60
switch on (5V) 0xFD 0x61
dimmer timeout 0xFD 0x70 0xYY 0xZZ with timeout  in 10th of seconds = 0xYY*256+0xZZ
example : 0xFD 0x70 0x01 0x13 -- > 3*256 +13 = 781 = 781 *1/10 = 78.1 seconds




   

VDR PLUGIN

under development,



OTHER NOTES

HD44780-based LCD modules

  1. Pin assignment

Pin number Symbol  Level   I/O Function
1 Vss - - Power supply (GND)
2 Vcc - - Power supply (+5V)
3 Vee - - Contrast adjust
4 RS 0/1 I 0 = Instruction input
1 = Data input
5 R/W 0/1 I 0 = Write to LCD module
1 = Read from LCD module
6 E 1, 1->0 I Enable signal
7 DB0 0/1 I/O Data bus line 0 (LSB)
8 DB1 0/1 I/O Data bus line 1
9 DB2 0/1 I/O Data bus line 2
10 DB3 0/1 I/O Data bus line 3
11 DB4 0/1 I/O Data bus line 4
12 DB5 0/1 I/O Data bus line 5
13 DB6 0/1 I/O Data bus line 6
14 DB7 0/1 I/O Data bus line 7 (MSB)

  1.  HD44780 Instruction set

Instruction Code Description Execution time**
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
Clear display 0 0 0 0 0 0 0 0 0 1 Clears display and returns cursor to the home position (address 0). 1.64mS
Cursor home 0 0 0 0 0 0 0 0 1 * Returns cursor to home position (address 0). Also returns display being shifted to the original position. DDRAM contents remains unchanged. 1.64mS
Entry mode set 0 0 0 0 0 0 0 1 I/D S Sets cursor move direction (I/D), specifies to shift the display (S). These operations are performed during data read/write. 40uS
Display On/Off control 0 0 0 0 0 0 1 D C B Sets On/Off of all display (D), cursor On/Off (C) and blink of cursor position character (B). 40uS
Cursor/display shift 0 0 0 0 0 1 S/C R/L * * Sets cursor-move or display-shift (S/C), shift direction (R/L). DDRAM contents remains unchanged. 40uS
Function set 0 0 0 0 1 DL N F * * Sets interface data length (DL), number of display line (N) and character font(F). 40uS
Set CGRAM address 0 0 0 1 CGRAM address Sets the CGRAM address. CGRAM data is sent and received after this setting. 40uS
Set DDRAM address 0 0 1 DDRAM address Sets the DDRAM address. DDRAM data is sent and received after this setting. 40uS
Read busy-flag and address counter 0 1 BF CGRAM / DDRAM address Reads Busy-flag (BF) indicating internal operation is being performed and reads CGRAM or DDRAM address counter contents (depending on previous instruction). 0uS
Write to CGRAM or DDRAM 1 0 write data Writes data to CGRAM or DDRAM. 40uS
Read from CGRAM or DDRAM 1 1 read data Reads data from CGRAM or DDRAM. 40uS
Remarks:
- DDRAM = Display Data RAM.
- CGRAM = Character Generator RAM.
- DDRAM address corresponds to cursor position.
- * = Don't care.
- ** = Based on Fosc = 250kHz.


Bit names
Bit name Setting / Status
I/D 0 = Decrement cursor position 1 = Increment cursor position
S 0 = No display shift 1 = Display shift
D 0 = Display off 1 = Display on
C 0 = Cursor off 1 = Cursor on
B 0 = Cursor blink off 1 = Cursor blink on
S/C 0 = Move cursor 1 = Shift display
R/L 0 = Shift left 1 = Shift right
DL 0 = 4-bit interface 1 = 8-bit interface
N 0 = 1/8 or 1/11 Duty (1 line) 1 = 1/16 Duty (2 lines)
F 0 = 5x7 dots 1 = 5x10 dots
BF 0 = Can accept instruction 1 = Internal operation in progress

see http://home.iae.nl/users/pouweha/lcd/lcd0.shtml


VIDEO OUTPUTS :

               
 


______
| 1 2 3 |
| 4 5 6 |
----------

1- GND
2- NC
3- GND
4- Y Luminance
5- C Chrominance
6- Comp. Out

Disconnect resistance R? from the Lintec Scart adaptor card otherwise  the DVB card and the Asus TV-OUT make a short on the composite signal.

Author

Frederic Pecourt

Feedback

f.pecourt


Last modified 19/01/2006