Jump to content


Photo

Xc8 Hitechc To Sourceboost Issues


1 reply to this topic

#1 ch701builder

ch701builder

    Newbrie

  • Members
  • 1 posts

Posted 21 September 2014 - 02:30 PM

All, I have given up on trying to pay $900+ dollars for XC8 and was wanting to start learning SourceBoostC.

 

I have found this example somewhere and had started to see how it works on my PICDEM 2 PLUS

 

The LCD doesn't display anything and only 1 or the other LEDs will flash.

MPLAB 8.9

BoostC 7.05

 

(the LED works in this example, but... the LCD doesn't display anything

**************************************************************************************************

#include <system.h>

#pragma CLOCK_FREQ 4000000

// configuration for PIC16F887
//     External Crystal at High Speed
//     Disable Watchdog Timer.
//     Enable Power Up Timer.
//     Disable Brown Out Reset.
//     MCLR function is enabled
//     Disable Low Voltage Programming.
#pragma DATA _CONFIG,     _HS_OSC &    
                        _WDT_OFF &
                        _PWRTE_ON &
                        _BOR_OFF &
                        _MCLRE_ON &
                        _LVP_OFF

// These setting are for the PICDEM2 PLUS board!
#define LCD_ARGS  1, /* Interface type: mode 0 = 8bit, 1 = 4bit(low nibble), 2 = 4bit(upper nibble) */ \
    1,               /* Use busy signal: 1 = use busy, 0 = use time delays */                          \
    PORTD, TRISD,    /* Data port and data port tris register */                                       \
    PORTD, TRISD,    /* Control port and control port tris register */                                 \
    4,               /* Bit number of control port is connected to RS */                               \
    5,               /* Bit number of control port is connected to RW */                               \
    6                /* Bit number of control port is connected to Enable */
#include <lcd_driver.h>  // LCD template code


void main()
{
    lcd_setup();
    lprintf("LCD is ON");
    
      trisb=0;              // Make all of portb output
    
    while(1)
    {
        clear_bit(portb,2);
        delay_ms(500);
        set_bit(portb,2);
        delay_ms(500);

    }; // while
} // main

**************************************************************************************************************

(in this while loop, only LED1 will flash, not LED2)

 

    while(1)
    {

        clear_bit(portb,1);
        clear_bit(portb,2);
        delay_ms(500);
        set_bit(portb,2);
        set_bit(portb,1);
        delay_ms(500);
    }; // while
} // main

 

 

Any suggestions.

 

The LCD is no big problem right now. My project doesn't use the LCD... but...

 

current project using XC8 for is

PIC16F887 (main IO)

28 - MUXED Analogs

4 - bitbang I2C

1 - bitband SPI

2 - UARTs

UART comm to PIC24FJ256DA210

used for display and User IO

 

running out of room using HiTechC/XC8 free mode, and don't want to spend $900+ dollars for XC8, especially since this is a hobby... (for now)

 

Any suggestions, am I overlooking something obvious for SourceBoost?

Thanks,

Keith

 

 



#2 Hiker

Hiker

    Newbrie

  • EstablishedMember
  • 11 posts

Posted 23 September 2014 - 11:56 AM

 
I only have a partial answer to the questions.

 

The delay routines is with an unsigned char argument, and when the compiler does not warn about to large constants, you will only get 244 mSec delay in the example. Generally I do not use these routines for more than small single digit microseconds, as it is an empty loop that blocks the processor to perform all other tasks than interrupts.


Edited by Hiker, 24 September 2014 - 09:51 AM.

/Hiker




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users