// -*- tab-width: 4 -*- // Serial Bitbang Example for HOODMICRO // // Copyright (c) 2005, K9spud LLC. // http://www.k9spud.com/hoodmicro/ // // Compile from command line: // picl -12F629 -Zg bitbang.c putch.as // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include __CONFIG(INTIO & WDTDIS & PWRTEN); #define bitset(var, bit) ((var) |= 1 << (bit)) #define bitclr(var, bit) ((var) &= ~(1 << (bit))) #define RX_PIN 0 #define TX_PIN 2 #define LED_PIN 4 extern void putch(char c); void main(void) { unsigned int i; unsigned char j = 0; INTCON = 0; // disable interrupts // configure all pins as inputs, except the LED_PIN and TX_PIN TRISIO = ~((1<