1 // Source by Philipp Krause under CC0 1.0
3 // A "Hello, World!"-Program. We use it to make the board
4 // output something that can not be mistaken for output
7 // "Hello, world!" on serial port A @ 38400 baud.
14 // _sdcc_external_startup, if present, will be called very early, before initalization
15 // of global objects. This makes it e.g. useful for dealing with watchdogs that might
16 // otherwise bite if there are many or large global objects that take a long time to initialize.
17 #if __SDCC_REVISION >= 13762
18 unsigned char __sdcc_external_startup(void)
20 unsigned char _sdcc_external_startup(void)
27 // normal oscillator, processor and peripheral from main clock, no periodic interrupt
35 while (SASR
& 0x04); // Wait for empty transmitter data register
42 PCFR
= 0x40; // Use pin PC6 as TXA
44 TAT4R
= 18 - 1; // Value in register is one less than the divider used (e.g. a value of 0 will result in clock division by 1).
45 TACSR
= 0x01; // Enable timer A
47 SACR
= 0x00; // No interrupts, 8-bit async mode
50 printf("Hello, World!\n");