Central Heating controller using the real time clock, PHY module for internet, 1-wire interface for temperature sensors, a system log and a configuration file

Dependencies:   net 1-wire lpc1768 crypto clock web fram log

/media/uploads/andrewboyson/heating.sch

/media/uploads/andrewboyson/heating.brd

/media/uploads/andrewboyson/eagle.epf

Revision:
104:46ce1aaf8be7
Parent:
53:c1bf7d9db507
--- a/lpc1768-this/periphs.c	Tue Jan 19 19:05:06 2021 +0000
+++ b/lpc1768-this/periphs.c	Wed Feb 10 17:24:36 2021 +0000
@@ -1,11 +1,13 @@
-#define PCONP    (*((volatile unsigned *) 0x400FC0C4))
-#define PCLKSEL0 (*((volatile unsigned *) 0x400FC1A8))
-#define PCLKSEL1 (*((volatile unsigned *) 0x400FC1AC))
-#define PINSEL0  (*((volatile unsigned *) 0x4002C000))
-#define PINSEL1  (*((volatile unsigned *) 0x4002C004))
-#define PINSEL2  (*((volatile unsigned *) 0x4002C008))
-#define PINSEL3  (*((volatile unsigned *) 0x4002C00C))
-
+#define PCONP       (*((volatile unsigned *) 0x400FC0C4))
+#define PCLKSEL0    (*((volatile unsigned *) 0x400FC1A8))
+#define PCLKSEL1    (*((volatile unsigned *) 0x400FC1AC))
+#define PINSEL0     (*((volatile unsigned *) 0x4002C000))
+#define PINSEL1     (*((volatile unsigned *) 0x4002C004))
+#define PINSEL2     (*((volatile unsigned *) 0x4002C008))
+#define PINSEL3     (*((volatile unsigned *) 0x4002C00C))
+#define PINSEL4     (*((volatile unsigned *) 0x4002C010))
+#define PINMODE4    (*((volatile unsigned *) 0x4002C050))
+#define PINMODE_OD2 (*((volatile unsigned *) 0x4002C070))
 
 void PeriphsInit (void)
 {
@@ -14,6 +16,7 @@
     PCONP |= 1 <<  1; //TIMER0
     PCONP |= 1 <<  2; //TIMER1
     PCONP |= 1 <<  3; //UART0
+    PCONP |= 1 <<  6; //PWM1
     PCONP |= 1 <<  9; //RTC
     PCONP |= 1 << 10; //SSP1
     PCONP |= 1 << 15; //GPIO
@@ -25,6 +28,7 @@
     PCLKSEL0 |= 1 <<  2;  //TIM0
     PCLKSEL0 |= 1 <<  4;  //TIM1
     PCLKSEL0 |= 1 <<  6;  //UART0
+    PCLKSEL0 |= 1 << 12;  //PWM1
     PCLKSEL0 |= 1 << 20;  //SSP1
 
     //Pin functions table 80.
@@ -50,4 +54,7 @@
     PINSEL3  = 0;
     PINSEL3 |= 1U <<  0; //P1.16 01 ENET_MDC
     PINSEL3 |= 1U <<  2; //P1.17 01 ENET_MDIO
+    
+    PINSEL4  = 0;
+    PINSEL4 |= 1U << 0;  //P2.00 01 PWM1.1 --> p26
 }