Peter1960
- 22nd June 2005, 23:58
Hello,
Aim -
To Read Status of Pins, A2 - A5 (4 bits)
Display on Other Pins, B4 - B7
Store Data in EEPROM Location 24 (Onboard)
Program 16F628a 4 mhz
*Usual Setups etc
ID var Byte
ID = 0
' Get Chip ID from PortA 2 - 5
If PortA.2 = 1 Then
ID = ID + 1
High PortB.4
EndIf
If PortA.3 = 1 Then
ID = ID + 2
High PortB.5
EndIf
If PortA.4 = 1 Then
ID = ID + 4
High PortB.6
EndIf
If PortA.5 = 1 Then
ID = ID + 8
High PortB.7
EndIf
Write 24,ID
If all ID were high I was expecting 0F in the location, however
the data pins showed correct, ie all high, but eeprom showed 0C.
Why?
Peter
Aim -
To Read Status of Pins, A2 - A5 (4 bits)
Display on Other Pins, B4 - B7
Store Data in EEPROM Location 24 (Onboard)
Program 16F628a 4 mhz
*Usual Setups etc
ID var Byte
ID = 0
' Get Chip ID from PortA 2 - 5
If PortA.2 = 1 Then
ID = ID + 1
High PortB.4
EndIf
If PortA.3 = 1 Then
ID = ID + 2
High PortB.5
EndIf
If PortA.4 = 1 Then
ID = ID + 4
High PortB.6
EndIf
If PortA.5 = 1 Then
ID = ID + 8
High PortB.7
EndIf
Write 24,ID
If all ID were high I was expecting 0F in the location, however
the data pins showed correct, ie all high, but eeprom showed 0C.
Why?
Peter