Jump to content

Xc8 Hitechc To Sourceboost Issues

Recommended Posts

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.


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 &

// 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()
lprintf("LCD is ON");

trisb=0; // Make all of portb output


}; // while
} // main


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



}; // 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?





Link to post
Share on other sites
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
Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...