Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About wd8cxb

  • Rank
  • Birthday 05/01/1964

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Gender
  • Location
    South Amherst, OH
  1. I am having trouble porting some of my old assembler routines written into assembler so I may use it in BoostC. I have tried upper case, lower case, // instead of ; everything imaginable but nothing works. Can anyone show me the errors of my way??? Thanks David Troike void RCV4800(void) { asm { //************************************************************************** //* RCV4800 * //* * //* Receives a byte at 4800 baud and places in RCVREG * //* * //************************************************************************** RCV4800: BCF INTCON,5 //disable TMR0 interrupts bcf INTCON,7 //disable global interrupts CLRF TMR0 //clear timer/Counter BSF STATUS,RP0 //to bank 1 MOVLW b'11011000' //set up timer/Counter MOVWF OPTION_REG BCF STATUS,RP0 //back to bank 0 MOVLW 0x08 //init shift Counter MOVWF Count SBIT: BTFSC PORTA, 0 //look for start bit GOTO SBIT //mark MOVLW 0x98 //start bit received, half bit time MOVWF TMR0 //load and start timer/Counter BCF INTCON,2 //clear TMR0 overflow flag TIME1: BTFSS INTCON,2 //timer overflow? GOTO TIME1 ;no BTFSC PORTA, 0 ;start bit still low? GOTO SBIT ;false start, go back MOVLW 0x30 ;real, define N for timer MOVWF TMR0 ;start timer/ctr - bit time BCF INTCON,2 ;clear TMR0 overflow flag TIME2: BTFSS INTCON,2 ;timer overflow? GOTO TIME2 ;no MOVLW 0x30 ;yes, define N for timer MOVWF TMR0 ;start timer/ctr BCF INTCON,2 ;clear TMR0 overflow flag MOVF PORTA,W ;read port A MOVWF _Temp ;store RRF _Temp,F ;rotate bit 0 into carry flag RRF _charRx_Byte,F ;rotate carry into RCVREG bit 7 DECFSZ _Count,F ;shifted 8? GOTO TIME2 ;no TIME3: BTFSS INTCON,2 ;timer overflow? GOTO TIME3 ;no RETURN ;yes, byte received } }
  2. I would like to use the rs232.c file found on the example page in BoostC. When I try to compile I get many errors. LCD_4.crs232.c(34): error: error in built-in assembly for this line BTFSC portb,RxD What exactly is the error. RxD is defined as 0. I have tried upper and lower case and even the _ before both portb and RxD. Nothing works. David Troike
  3. SourceBoost is great!! Received software on Wed and by Friday had a very large working program. I figure that if I was to write this same program in assembler it would take at least two weeks to complete. I have even ported over some programs that I wrote in Dynamic C for the Rabbit and they worked with only a few minor syntax changes. What a great program for the money. I really like the way it outputs the compiled code in assembler. I have entered C language commands to see how it is compiled in to assembler, this is a great way for people to learn assembler too! David Troike Electrical Design Engineer Machine Applications Corp. www.macinstruments.com dave@macinstruments.com
  4. Thanks, I can see it was just a matter of syntax. I was confused between what does and what does not get uppercased. I was looking at the old program samples too and they always come up with the error obsolte variable. So was not sure what was or was not correct. Thanks again, Dave. Regards; David
  5. I am really having a tuff time getting started. I have tried simple programs and can't get any of them to compile in either BoostC or C2C. I have tried many times to just write a simple program and they all fail. I can program it quicker in ASM. This is no fault of SourceBoost rather just me being a newbie. Here is an example of my problem. I can set all this via assembler but can't see to do this via "C". I have tried both upper and lower case for example PORTA or porta. Nothing seems to work. Can anyone correct my listing so I can see where I am going wrong. This is for a PIC16F873 #include <system.h> asm __CONFIG _CP_OFF &_WDT_OFF &_PWRTE_ON &_BODEN_OFF &_HS_OSC &_LVP_OFF &_WRT_ENABLE_OFF &_DEBUG_OFF void main (void) { set_bit(STATUS,RP0); //SELECT BANK 1 ADCON1 = 00000110b; //TURN OFF A/D PORT A OPTION_REG = 0; //ENABLE PORTB PULLUP RESISTERS trisa = 00011111b; //SET ALL PORT A PINS AS INPUTS trisb = 0; //SET ALL PORT B PINS AS OUTPUTS trisc = 10000000b; //SET RC7 AS INPUT set_bit (TXSTA,TXEN); //TXEN = 1 ENABLE ASYNCRONOUS TRANSMISSION set_bit (TXSTA,BRGH); //BRGH = 1 ENABLE HIGH SPEED TX SPBRG = 103; //BRGH=1 SPBRG=103/ BRGH=0 SPBRG = 24 set_bit (PIE1,RCIE); //RCIE=1 FOR SERIAL RX INTERRUPT ENABLE clear_bit(STATUS,RP0); //SELECT BANK 0 PORTA = 0; PORTB = 0; PORTC = 0; RCREG = 0; //CLEAR SERIAL RECEIVE REGISTER TXREG = 0; //CLEAR SERIAL TRANSMIT REGISTER set_bit(RCSTA,SPEN); //SPEN=1 FOR SERIAL PORT ENABLE set_bit(RCSTA,CREN); //CREN = 1 FOR COUNTINOUS RX ENABLE while(1) { set_bit(PORTA, 1); } }
  • Create New...