Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

XC8 MPLABX reading documentation problems

Status
Not open for further replies.

Ivan-Holm

Member level 5
Member level 5
Joined
Jun 3, 2010
Messages
84
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Location
Denmark
Activity points
1,894
I was looking for how to write TrisAbits = 0; and TrisB =0x00; and the same for Port A&B but I cant find it in the documentation, and MPLABx say it not how it written ,can someone link to the documentation with examples :)
if others have others problems to understand the Compilor just post under this thread.
 

TrisAbits = 0 doesn't make any sense. Either you would need to specify which bit you want to make zero or sign the whole of TRISA.

The documentation with some of Microchip's compilers is terrible. Some information is hard to find and some just doesn't exist meaning you have to read the include files supplied. There is also a lack of consistency from one processor to another.

Try TRISA = 0b01010101;
to set the whole byte, for example or TRISA2 = 0b1;
to set a specific bit e.g. bit 2.

Keith

- - - Updated - - -

Just to add, if you hit F11 from MPLAB should load the XC8 complier user manual.

c:\program files\Microchip\XC8\v1.20\docs includes some information as well - try the XC8MasterIndex.htm file.

The following may be useful, although the exact names of some registers will be processor specific:

For dealing with the whole byte:
Code:
ANSELA = 0b000000;	
LATA   = 0b000111;
TRISA  = 0b001000;
WPUA   = 0b001000;

For dealing with individual bits:

Code:
IOCBN5      = 0b1;
LATA2 	= 0b0;
ANSA2	= 0b0;
TRISA2	= 0b0;
CCP1CONbits.P1M = 0b00;
CCP1CONbits.DC1B = 0b01;
T2CONbits.T2CKPS = 0b01;
 

tank you I use Mplabx so F11 doesn't work, I agree some off the config setup is also confusing, I also try to setup Internal clock but in the documentations it doesn't say with internal clock it will use I use for this littel project an pic16f88 and there is 2 internal clock 8Mhz and 31.25khz if you see Fig. 4-6 page 43 https://ww1.microchip.com/downloads/jp/DeviceDoc/30487c.pdf it also say some about some IRCF registre but I cut not find it in the config Help File I used to set up the Config reg.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top