Recent content by Tony P

  1. T

    18M2 RTC

    Sorted thank you. The RTC module that I used for my heating time clock has indeed got the required pull ups. This new RTC has not even though I purchased them as a job lot of, what I assumed were, identical modules. Two 4k7's added and I'm all good to go:)
  2. T

    18M2 RTC

    No I dont. I didn't realise that I needed them!. But I have other clock circuits happily running, such as a central heating time clock, using 18M2 and the same RTC's without the resistors!
  3. T

    18M2 RTC

    I am trying to connect an RTC to the CH1030A project board but cannot get it to work. I am using the centre non-buffered pins B.1 (SDA) and B.4 (SCL) as normal but I am not getting the RTC to run. I have tested the 18M2 and the RTC on the AXE091 project board and all work fine. Any ideas please?
  4. T

    Better coding

    Yes. I use BCDTOASCI to convert seconds, mins, hours etc and then use $seconds for the value
  5. T

    Better coding

    Thank You PieM, just what I wanted.:)
  6. T

    Better coding

    If you just read the seconds from the RTC they go 0 to 9 then 16 to 25 etc.
  7. T

    Better coding

    How could I shorten the following code? I have made an electromagnetic pendulum clock and am using an 18M2 to control the pulses and timing. This is a section of code that I use to count the actual seconds (RTC) and the amount of pulses sent to the pendulum. The pendulum is deliberately set to...
  8. T

    Shorter code?

    Ahh thank you. It all makes sense now. Many thanks for your time
  9. T

    Shorter code?

    Clear as mud :) Where in the manual is a reference to the $0F ?
  10. T

    Shorter code?

    Thank you again hippy. I have allocated S_W1 to S_W6 as temporary variables and can now use your LOOKUP code and also your shorter version of the mins/seconds code. I must now look into the 'maths' side of programming to learn more about the & $0F // 5 :)
  11. T

    Shorter code?

    Could the following code be reduced in any way? IF MINS=$0 AND SECONDS=$1 THEN GOTO MAIN IF MINS=$5 AND SECONDS=$1 THEN GOTO MAIN IF MINS=$10 AND SECONDS=$1 THEN GOTO MAIN IF MINS=$15 AND SECONDS=$1 THEN GOTO MAIN IF MINS=$20 AND SECONDS=$1 THEN GOTO MAIN IF MINS=$25 AND...
  12. T

    Shorter code?

    Thank you hippy. I have just realised that I have run out of variables so I have to stick to my original code as your's uses two :(
  13. T

    Shorter code?

    Below is a section of code that I have within a Program. I am reading an RTC and outputting day, date, time etc etc. This code works fine but I was wondering if it can be made shorter in any way using something like 'Lookup' or 'Select case'? IF DAY=$1 THEN SEROUT...
  14. T

    Timeclock

    It is something I have always done using the following code. I can enter actual time (0-23) and date values (0 to 31) i2cslave %11010000, i2cslow, i2cbyte hi2cin 0,(SECONDS,MINS,HOUR,DAY,DATE,MONTH,YEAR) BCDTOASCII DATE,DATE_T,DATE_U BCDTOASCII HOUR,HR_T,HR_U BCDTOASCII...
  15. T

    Timeclock

    I have re-written all of my lines as you suggest. It works fine in the simulator. I will download the code to my thermostat and give it a try
Top