Jump to content
Sign in to follow this  
ch701builder

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.

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

 

 

Share this post


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

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum 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.

Loading...
Sign in to follow this  

×