Thanks Joe S for sticking with this !
Mabye a little more detail on the mechaatronics demo board. Its pre-wired to drive directly an on-board 3 1/2 digit 7 segment numeric display via the SEG pins . The right hand charactor segments are labeled 1a,1b,1c,1d,1e,1f,1g. the middle charactor segments are labled 2a,2b,2c -- etc through to the left hand third charactor 3g.
The fourth charactor is only a '1' and is labled 4b and 4c.
Also on the display are numerous logos ie battery,negative sign,speaker,diode,Volts,Amps etc (like a cheap multimeter digital display)
(i hope the below formats properly)
---3a-- --2a-- --1a--
| | | | | | |
4b 3f 3b 2f 2b 1f 1b
| | | | | | |
---3g-- ---2g-- --1g--
| | | | | | |
4c 3e 3c 2e 2c 1e 1c
| | | | | | |
---3d--- ---3d--- --1d--
Now these are mapped onto the 16f917 registers LCDDATA0 through to LCDDATA11 in what seems almost at random. To give you a small flavour ( if this formats correctly) of the first four registers:-
LCDDATA0 LCDDATA1 LCDDATA2 LCDDATA3
bit0 A - s1 V
bit1 RC - - BATT
bit2 DH - - RH
bit3 3a 3b - 3f
bit4 - - - -
bit5 - - 2b -
bit6 2a - 1a 2f
bit7 - - 1b -
where -=not connected, and A,RC,DH,BATT,RH,s1 are some of the logos mentioned above
this mapping continues all the way to register LCDDATA11
As for my code. This is very initial playing with the demo board, no actual programs yet, just seeing how it works. 'Hello world' stuff on the display
So appart from initial initialisation of the LCDSE0,LCDSE1 and LCDSE2 registers to allow for using the pins as lcd direct drive (SEG0 to SEG23 on the pic16917 pins) - Thats all im doing so far. Each code line sets just one bit in a LCDDARA register which maps to one lcd display element ie
LCDDATA2.6 = 1 switches on lcd element 1a
LCDDATA2.7 = 0 switches off lcd element 1b
by doing this one by one Im able to swith on/off all elements in the diplay, and so in my code displayed above :-
" lcddata2.6=1 'seg a
lcddata2.7=1 'seg b
lcddata8.7=1 'seg c
lcddata11.6=1 'seg d
lcddata8.6=1 'seg e
lcddata5.6=1 'seg f
lcddata5.7=1 'seg g "
im switching on all the elements in the 1st charactor 7-segment display.
My real problem is therefore that these display elements are spread all over the LCDDATA registers and im creating charactor displays by manipulating register bits one by one.
Im therefore trying to cut down on the above by trying to see if i can group the sets of register bits in some way in array or table etc,
for example :- ( in pseudocode 'cos i dont know if it can be done in picbasic)
CHR0 var byte(lcddata2.6,lcddata2.7,lcddata8.7,lcddata11.6, lcddata8.6,lcddata5.6,lcddata5.7)
if this can be done ( my original question) then i can feed the byte patterns to VAR CHR0 (directly or by lookup table) to change the Right hand numeric display charactor as needed.
I hope the above explains things
Alastair
Bookmarks