My DS1307 on the PDB work well with a BS2pe but I can't make it to work with a
jmbertoncelli@USA
Posts: 48
Work just fine with the BS2pe but doesn't with my px24???
some help could be welcome.
thanks
jm.
Here is my code:
' {$STAMP BS2pe}
' {$PBASIC 2.5}
' {$PORT COM14}
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
··· T1200······ CON···· 813
··· T2400······ CON···· 396
··· T4800······ CON···· 188
··· T9600······ CON···· 84
··· T19K2······ CON···· 32
··· T38K4······ CON···· 6
· #CASE BS2SX, BS2P
··· T1200······ CON···· 2063
··· T2400······ CON···· 1021
··· T4800······ CON···· 500
··· T9600······ CON···· 240
··· T19K2······ CON···· 110
··· T38K4······ CON···· 45
· #CASE BS2PX
··· T1200······ CON···· 3313
··· T2400······ CON···· 1646
··· T4800······ CON···· 813
··· T9600······ CON···· 396
··· T19K2······ CON···· 188
··· T38K4······ CON···· 84
#ENDSELECT
#SELECT $STAMP
· #CASE BS2, BS2E
··· DurAdj····· CON···· $100··················· ' Duration / 1
· #CASE BS2SX
··· DurAdj····· CON···· $280··················· ' Duration / 0.400
· #CASE BS2P, BS2PX
··· DurAdj····· CON···· $37B··················· ' Duration / 0.287
· #CASE BS2PE
··· DurAdj····· CON···· $163··················· ' Duration / 0.720
#ENDSELECT
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
··· I2CDAT····· PIN···· 0
· #CASE BS2SX, BS2P
· #CASE BS2PX
··· I2CDAT····· PIN···· 8
#ENDSELECT
rtcREGS VAR Byte(10)
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
· #CASE BS2SX, BS2P
· #CASE BS2PX
· CONFIGPIN DIRECTION,· %0000000000000000
· CONFIGPIN PULLUP,···· %0000000000000000
· CONFIGPIN THRESHOLD,· %0000000000000000
· CONFIGPIN SCHMITT,··· %0000000000000000
#ENDSELECT
I2COUT I2CDAT,$D0,$00,[noparse][[/noparse]%00000001]
I2COUT I2CDAT,$D0,$01,[noparse][[/noparse]%00000000]
I2COUT I2CDAT,$D0,$02,[noparse][[/noparse]%00000110]
I2COUT I2CDAT,$D0,$03,[noparse][[/noparse]$07]
I2COUT I2CDAT,$D0,$04,[noparse][[/noparse]$01]
I2COUT I2CDAT,$D0,$05,[noparse][[/noparse]$01]
I2COUT I2CDAT,$D0,$06,[noparse][[/noparse]$09]
main:
I2CIN I2CDAT,$D0,$00,[noparse][[/noparse]STR rtcREGS\8]
DEBUG CRSRXY, 1, 1,HEX2 rtcREGS(0)
DEBUG CRSRXY, 1, 2,HEX2 rtcREGS(1)
DEBUG CRSRXY, 1, 3,HEX2 rtcREGS(2)
DEBUG CRSRXY, 1, 4,HEX2 rtcREGS(3)
DEBUG CRSRXY, 1, 5,HEX2 rtcREGS(4)
DEBUG CRSRXY, 1, 6,HEX2 rtcREGS(5)
DEBUG CRSRXY, 1, 7,HEX2 rtcREGS(6)
DEBUG CRSRXY, 1, 8,HEX2 rtcREGS(7)
DEBUG CRSRXY, 1, 9,HEX2 rtcREGS(8)
PAUSE 100
GOTO main
STOP
·
some help could be welcome.
thanks
jm.
Here is my code:
' {$STAMP BS2pe}
' {$PBASIC 2.5}
' {$PORT COM14}
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
··· T1200······ CON···· 813
··· T2400······ CON···· 396
··· T4800······ CON···· 188
··· T9600······ CON···· 84
··· T19K2······ CON···· 32
··· T38K4······ CON···· 6
· #CASE BS2SX, BS2P
··· T1200······ CON···· 2063
··· T2400······ CON···· 1021
··· T4800······ CON···· 500
··· T9600······ CON···· 240
··· T19K2······ CON···· 110
··· T38K4······ CON···· 45
· #CASE BS2PX
··· T1200······ CON···· 3313
··· T2400······ CON···· 1646
··· T4800······ CON···· 813
··· T9600······ CON···· 396
··· T19K2······ CON···· 188
··· T38K4······ CON···· 84
#ENDSELECT
#SELECT $STAMP
· #CASE BS2, BS2E
··· DurAdj····· CON···· $100··················· ' Duration / 1
· #CASE BS2SX
··· DurAdj····· CON···· $280··················· ' Duration / 0.400
· #CASE BS2P, BS2PX
··· DurAdj····· CON···· $37B··················· ' Duration / 0.287
· #CASE BS2PE
··· DurAdj····· CON···· $163··················· ' Duration / 0.720
#ENDSELECT
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
··· I2CDAT····· PIN···· 0
· #CASE BS2SX, BS2P
· #CASE BS2PX
··· I2CDAT····· PIN···· 8
#ENDSELECT
rtcREGS VAR Byte(10)
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
· #CASE BS2SX, BS2P
· #CASE BS2PX
· CONFIGPIN DIRECTION,· %0000000000000000
· CONFIGPIN PULLUP,···· %0000000000000000
· CONFIGPIN THRESHOLD,· %0000000000000000
· CONFIGPIN SCHMITT,··· %0000000000000000
#ENDSELECT
I2COUT I2CDAT,$D0,$00,[noparse][[/noparse]%00000001]
I2COUT I2CDAT,$D0,$01,[noparse][[/noparse]%00000000]
I2COUT I2CDAT,$D0,$02,[noparse][[/noparse]%00000110]
I2COUT I2CDAT,$D0,$03,[noparse][[/noparse]$07]
I2COUT I2CDAT,$D0,$04,[noparse][[/noparse]$01]
I2COUT I2CDAT,$D0,$05,[noparse][[/noparse]$01]
I2COUT I2CDAT,$D0,$06,[noparse][[/noparse]$09]
main:
I2CIN I2CDAT,$D0,$00,[noparse][[/noparse]STR rtcREGS\8]
DEBUG CRSRXY, 1, 1,HEX2 rtcREGS(0)
DEBUG CRSRXY, 1, 2,HEX2 rtcREGS(1)
DEBUG CRSRXY, 1, 3,HEX2 rtcREGS(2)
DEBUG CRSRXY, 1, 4,HEX2 rtcREGS(3)
DEBUG CRSRXY, 1, 5,HEX2 rtcREGS(4)
DEBUG CRSRXY, 1, 6,HEX2 rtcREGS(5)
DEBUG CRSRXY, 1, 7,HEX2 rtcREGS(6)
DEBUG CRSRXY, 1, 8,HEX2 rtcREGS(7)
DEBUG CRSRXY, 1, 9,HEX2 rtcREGS(8)
PAUSE 100
GOTO main
STOP
·
Comments
Thanks for your help.
jm.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
50 72 6F 6A 65 63 74 20 53 69 74 65
·
A shot in the dark but maybe the DS1307 memory is corrupted...
thanks anyway for the idea.
jm.