diff --git a/photos/stencil.jpg b/photos/stencil.jpg new file mode 100644 index 0000000..699f789 Binary files /dev/null and b/photos/stencil.jpg differ diff --git a/photos/stencil_details.jpg b/photos/stencil_details.jpg new file mode 100644 index 0000000..5851680 Binary files /dev/null and b/photos/stencil_details.jpg differ diff --git a/test/serial.c b/test/serial.c new file mode 100644 index 0000000..985ca7c --- /dev/null +++ b/test/serial.c @@ -0,0 +1,42 @@ +#include +#include + + +#define BAUD 9600UL // baudrate + +// Some calculations ... +#define UBRR_VAL ((F_CPU+BAUD*8)/(BAUD*16)-1) // rounding magic +#define BAUD_REAL (F_CPU/(16*(UBRR_VAL+1))) // Real baudrate +#define BAUD_ERROR ((BAUD_REAL*1000)/BAUD) // Error in 0,1% + +#if ((BAUD_ERROR<990) || (BAUD_ERROR>1010)) // Make sure your UBRR_VAL will work + #error Baudrate error is bigger then 1% ! +#endif + + + +int main(void) { + + UBRRH = UBRR_VAL >> 8; //Setting baudrate + UBRRL = UBRR_VAL & 0xFF; + + UCSRB |= (1<