News:

Let's find out together what makes a PIC Tick!

Main Menu

Bit area

Started by Teo, Nov 15, 2023, 11:41 PM

Previous topic - Next topic

Teo

Hi,
Is it possible to create a bit area?
Basically, I have to make a Dword with indexable bits.
Thanks in advance,
Teo

JonW

#1
You can access the bits directly in the DWORD by MYDWORD.BIT where bit is 0 to 31. Or Alias the bits directly to reference the bit (Good for status flag control etc).  See P30 in 8bit manual


Device = 18F23K22

Xtal = 16


Dim MYDWORD As Dword

Dim MD1 As MYDWORD.1
Dim MD2 As MYDWORD.31



Main:
    MD1  = 1
    MD2 = 0
    GoTo Main

Teo

Hi JonW
Thanks a lot !
Teo