All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Programmer's Corner

Notices

Programmer's Corner Discussion forum for all aspects of programming and software engineering. Any software programming language welcome: C, C++, C#, Fortran, Java, Matlab, etc.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 05-17-2011, 02:11 AM
Dalaran Dalaran is offline
Senior Member
 
Join Date: Dec 2009
Posts: 165
Default Porting to MPLAB IDE

I was using the demo version of mikroElectroikas software but soon turned out the 2k program size is not large enough. When going to MPLAB (using C language) I ended up with a few problems was hoping someone could help me on.

First this is what I was using in mikro for setting up the LCD

Code:
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;

sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
Select All
But MPLAB doesn't seem to like these commands.

Also, even with commenting all of these references out I get the following error when building:

Code:
Error   [491] ; . can't find 0x5C words for psect "rbss_0" in segment "BANK0"
Select All
Any ideas?

Thanks!

edit: When I look through the Memory Usage Map, BANK0 of the Data Space section is almost completely full. As soon as I add a division or something like that it exceeds it and gives me the error. Any idea why this is occuring? How do I move to Bank1, etc.

Last edited by Dalaran; 05-17-2011 at 02:50 AM.
Reply With Quote
  #2  
Old 05-17-2011, 07:03 AM
t06afre's Avatar
t06afre t06afre is offline
Senior Member
 
Join Date: May 2009
Posts: 5,939
Default

MPLAB is just an IDE. You must tell us which program language/compiler you use. And also name you MCU
Reply With Quote
  #3  
Old 05-17-2011, 08:11 PM
Dalaran Dalaran is offline
Senior Member
 
Join Date: Dec 2009
Posts: 165
Default

Thanks for the reply.

I program in C.
Hi-Tech C Complier.
Using PIC16F886.
EasyPic6 development board.

Cheers.
Reply With Quote
  #4  
Old 05-18-2011, 10:10 AM
t06afre's Avatar
t06afre t06afre is offline
Senior Member
 
Join Date: May 2009
Posts: 5,939
Default

The sbit is something MicroC use to set bits in the SFRs. In Hitech C is done somewhat different. To understand take a look at the file pic16f886.h in the Hitech C compiler install folder (the include folder)
So you can do something like this
Code:
#define LCD_RS RA3
#define LCD_RW RA2
#define LCD_EN RA1
#define LCD_DATA PORTD
.
.
.
main
{
 LCD_RW=1;
LCD_DATA=0xfa;
}
Select All
But you better post your full MicroC code.
Reply With Quote
Reply   Post New Thread

Tags
, ,


Similar Threads
Thread Thread Starter Forum Replies Last Post
Watch Window in MPLab IDE Guinness1759 Embedded Systems and Microcontrollers 4 01-20-2011 01:36 AM
MPLAB IDE 8.43 error RG23 Embedded Systems and Microcontrollers 2 01-06-2011 02:51 PM
Column mode in MPLAB IDE (undocumented feature) Markd77 Embedded Systems and Microcontrollers 0 08-01-2010 09:27 PM
MPLAB IDE small question hazim Embedded Systems and Microcontrollers 16 03-18-2010 05:52 PM
Proplem with MPLAB and assembly steinar96 Embedded Systems and Microcontrollers 2 07-10-2009 12:27 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:05 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.