Search results

  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
  16. T

    Timeclock

    SORRY i may have just posted the wrong line of code. This line is the one I meant to post IF DAY=$1 OR DAY=$7 AND HOUR>=$18 AND HOUR <=$23 THEN LET HEAT=20:RETURN:END IF This mixes AND and OR but works fine
  17. T

    Timeclock

    It jumps to the next line of code which turns the HEAT up to 20 after 17:00 hours. It too works in my simulator but not in 'real life'
  18. T

    Timeclock

    I have made a heating time clock which is working fine with the exception of the following line. IF DAY=$1 OR DAY=$7 AND HOUR>=$09 AND HOUR <=$17 THEN LET HEAT=19:RETURN:END IF This only works for day $7 (Saturday) and not day $1 (Sunday)
  19. T

    Two PICs Serin/Serout problem

    I am trying to get an 08M2 to send and receive commands to an 18M2 which has two stepper motors wired. The test code below works perfectly, turning each motor (1 to 4) a set number of pulses.(25 in this example) The first few lines of the 18M2 are: SERIN C.2,N2400,B20,B21 IF B20=1 THEN GOSUB...
  20. T

    Code change

    I made a vivarium controller some months ago which is working as planned. It controls the light on/off at set times and controls the heat lamp, increasing the temperature in the morning, holding a set temperature all day and decreasing at night. With trial and error I found that checking the...
Top