Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4747

Definning a VAR for Different Register Bits

$
0
0
Hi all,

I'm playing with a multiplexed LCD display that has 4 commons. The PIC that I'm using is the 16F1939. This PIC has a bunch of registers to set the segments in the LCD either on or off. Here are some of the registers,

Quote:

• LCDDATA0 SEG<7:0>COM0
• LCDDATA1 SEG<15:8>COM0
• LCDDATA2 SEG<23:16>COM0(1)
• LCDDATA3 SEG<7:0>COM1
• LCDDATA4 SEG<15:8>COM1
• LCDDATA5 SEG<23:16>COM1(1)
• LCDDATA6 SEG<7:0>COM2
• LCDDATA7 SEG<15:8>COM2
• LCDDATA8 SEG<23:16>COM2(1)
• LCDDATA9 SEG<7:0>COM3
• LCDDATA10 SEG<15:8>COM3
• LCDDATA11 SEG<23:16>COM3(1)
What I'm trying to do is to define a variable that contains different bits from different registers. For example, I want to define the following variable

Code:

DIGIT1.0 = LCDDATA0.0
DIGIT1.1 = LCDDATA3.0
DIGIT1.2 = LCDDATA6.0
DIGIT1.3 = LCDDATA9.0
DIGIT1.4 = LCDDATA0.1
DIGIT1.5 = LCDDATA3.1
DIGIT1.6 = LCDDATA6.1
DIGIT1.7 = LCDDATA9.1

Can this be done using VAR or SYMBOL? Any ideas / comments?

Thank you,

Robert

Viewing all articles
Browse latest Browse all 4747

Trending Articles