3 Toggles an LED on Pin 1 of PORTB on a PIC16F627. Written
4 as a sample for the article on using SDCC and GPSIM in
5 Linux. http://www.micahcarrick.com/v2/content/view/14/4/
7 Compile: sdcc --debug -mpic14 -p16f628a test.c
8 Simulate: gpsim -c env.conf -s test.cod
12 /* Define processor and include header file. */
14 #include "pic/pic16f628a.h"
16 /* Setup chip configuration */
17 typedef unsigned int config
;
18 config at
0x2007 __CONFIG
= _CP_OFF
&
26 #define b0 0x01 /* pin 1 on PORTB */
27 #define B_OUTPUTS 0xfa /* value used to setup TRISB */
32 /* PORTB.1 is an output pin */
35 //BRGH = 1; // baudrate class
38 SYNC
= 0; /* Asynchronous */
39 SPEN
= 1; /* Serial port enable*/
40 TXEN
= 1; /* Tx enable */
43 static void send_byte(char alpha
) {
54 while(1) { /* Loop forever */
56 //PORTB = (PORTB ^ b0);
58 for (i
= 0; i
< 2000; i
++);