Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

Discussion Groups | Piclist | how do you make port a and B in or output in CCS ?

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

how do you make port a and B in or output in CCS ? - Vincent - Aug 30 13:33:00 2005

Message
Hi all,
 
working on a PIC16F628, I try to configure its I/O with pull-ups on B port and set Input or output direction on port A and B...
 
output_float(pin_A1);
output_float(pin_A2);
output_float(pin_A3);
output_float(pin_A5);
output_float(pin_A6);
output_float(pin_A7);
output_float(pin_B0);
output_float(pin_B6);
output_float(pin_B7);
 
gives nothing...
 
No mre than :
#use fixed_io(a_outputs=PIN_A4)
#use fixed_io(b_outputs=PIN_B1,PIN_B2,PIN_B3,PIN_B4,PIN_B5)
 
 
#USE STANDARD_IO(B)
#USE STANDARD_IO(A)
with
 SET_TRIS_A( 0x10 ); // PORTA  RA7-RA0 = Out Out Out In Out Out Out Out
 SET_TRIS_B( 0xC1 ); // PORTB  RB7-RB0 = In In Out Out Out Out Out In
 
Can anyone help to clearly define what needs to be done ????
 
By the way, any pointers to good documentation or tuts for CCS would be great !!
The Help files is rather poor even if many exemples do well !!
 
Thank a lot !
 
Vince




(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )


RE: Re: how do you make port a and B in or output in CCS ? - Vincent - Aug 31 3:47:00 2005

Thank for this but that's not exactly what I need !

I have no problem with the '628. I do anything I need in asm.
My problem is not with the internal register and the way to use them...
My problem is more related to CCS it self...

How do you configure Inputs/Outputs ports in CCS ???

Actually, I am trying to translate my asm code in C... But it's a fail for
the moment because of IO malfuntions !!!

If anyone has a snipet of code as a starting exemple, that would be
sufficient !!

Thanks for any helping hand !!

Vincent

-----Original Message-----
From: piclist@picl... [mailto:piclist@picl...] On Behalf Of
rtstofer
Sent: mercredi 31 août 2005 06:10
To: piclist@picl...
Subject: [piclist] Re: how do you make port a and B in or output in CCS ? --- In piclist@picl..., "Vincent" <vincent.clerc@i...> wrote:
> Hi all,
>
> working on a PIC16F628, I try to configure its I/O with pull-ups
on B port
> and set Input or output direction on port A and B...
>
> output_float(pin_A1);
> output_float(pin_A2);
> output_float(pin_A3);
> output_float(pin_A5);
> output_float(pin_A6);
> output_float(pin_A7);
> output_float(pin_B0);
> output_float(pin_B6);
> output_float(pin_B7);
>
> gives nothing...
>
> No mre than :
> #use fixed_io(a_outputs=PIN_A4)
> #use fixed_io(b_outputs=PIN_B1,PIN_B2,PIN_B3,PIN_B4,PIN_B5) > #USE STANDARD_IO(B)
> #USE STANDARD_IO(A)
> with
> SET_TRIS_A( 0x10 ); // PORTA RA7-RA0 = Out Out Out In Out Out
Out Out
> SET_TRIS_B( 0xC1 ); // PORTB RB7-RB0 = In In Out Out Out Out Out
In
>
> Can anyone help to clearly define what needs to be done ????
>
> By the way, any pointers to good documentation or tuts for CCS
would be
> great !!
> The Help files is rather poor even if many exemples do well !!
>
> Thank a lot !
>
> Vince

One of the things that will bite you with the '628 is CMCON. By
default, PORTA is analog.

You should get the datasheet for the device and the Mid-Range MPU
manual.
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

Yahoo! Groups Links





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: how do you make port a and B in or output in CCS ? - rtstofer - Aug 31 4:09:00 2005

--- In piclist@picl..., "Vincent" <vincent.clerc@i...> wrote:
> Hi all,
>
> working on a PIC16F628, I try to configure its I/O with pull-ups
on B port
> and set Input or output direction on port A and B...
>
> output_float(pin_A1);
> output_float(pin_A2);
> output_float(pin_A3);
> output_float(pin_A5);
> output_float(pin_A6);
> output_float(pin_A7);
> output_float(pin_B0);
> output_float(pin_B6);
> output_float(pin_B7);
>
> gives nothing...
>
> No mre than :
> #use fixed_io(a_outputs=PIN_A4)
> #use fixed_io(b_outputs=PIN_B1,PIN_B2,PIN_B3,PIN_B4,PIN_B5) > #USE STANDARD_IO(B)
> #USE STANDARD_IO(A)
> with
> SET_TRIS_A( 0x10 ); // PORTA RA7-RA0 = Out Out Out In Out Out
Out Out
> SET_TRIS_B( 0xC1 ); // PORTB RB7-RB0 = In In Out Out Out Out Out
In
>
> Can anyone help to clearly define what needs to be done ????
>
> By the way, any pointers to good documentation or tuts for CCS
would be
> great !!
> The Help files is rather poor even if many exemples do well !!
>
> Thank a lot !
>
> Vince

One of the things that will bite you with the '628 is CMCON. By
default, PORTA is analog.

You should get the datasheet for the device and the Mid-Range MPU
manual.





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

RE: how do you make port a and B in or output in CCS ? - Vincent - Aug 31 14:28:00 2005

Message

 Hi all,
 
I finally found the problem.
 
It was a bad intercation with the FUSES that causes my PIC to be unstable.
Pin MCLR is used in my design, and the fuse was not set to reflect that...
 
My pic was maintain in reset state, giving the apparent bad pin state programmation !
 
Thanks a lot to those how answered !
Vince
 
 -----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of Vincent
Sent: mardi 30 août 2005 19:33
To: p...@yahoogroups.com
Subject: [piclist] how do you make port a and B in or output in CCS ?

Hi all,
 
working on a PIC16F628, I try to configure its I/O with pull-ups on B port and set Input or output direction on port A and B...
 
output_float(pin_A1);
output_float(pin_A2);
output_float(pin_A3);
output_float(pin_A5);
output_float(pin_A6);
output_float(pin_A7);
output_float(pin_B0);
output_float(pin_B6);
output_float(pin_B7);
 
gives nothing...
 
No mre than :
#use fixed_io(a_outputs=PIN_A4)
#use fixed_io(b_outputs=PIN_B1,PIN_B2,PIN_B3,PIN_B4,PIN_B5)
 
 
#USE STANDARD_IO(B)
#USE STANDARD_IO(A)
with
 SET_TRIS_A( 0x10 ); // PORTA  RA7-RA0 = Out Out Out In Out Out Out Out
 SET_TRIS_B( 0xC1 ); // PORTB  RB7-RB0 = In In Out Out Out Out Out In
 
Can anyone help to clearly define what needs to be done ????
 
By the way, any pointers to good documentation or tuts for CCS would be great !!
The Help files is rather poor even if many exemples do well !!
 
Thank a lot !
 
Vince




(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Re: how do you make port a and B in or output in CCS ? - KM6VV - Sep 4 18:06:00 2005

Hi,

Yeah, I've ran into that!

Miss-set comparitor settings can also kill digital inputs on shared pins.

And just wondering, I have the mid-range manual, but I don't recall seeing a
high-range MPU manual. (18F4620 or there abouts). I have several data sheets
for the 18F's I'm interested in.

Alan KM6VV rtstofer wrote:

> --- In piclist@picl..., "Vincent" <vincent.clerc@i...> wrote:
>
>>Hi all,
>>
>>working on a PIC16F628, I try to configure its I/O with pull-ups
>
> on B port
>
> <SNIP>
>>
>>Vince > One of the things that will bite you with the '628 is CMCON. By
> default, PORTA is analog.
>
> You should get the datasheet for the device and the Mid-Range MPU
> manual.




(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Re: how do you make port a and B in or output in CCS ? - KM6VV - Sep 4 18:22:00 2005

Hi Vincent,

see SET_TRIS_B() in the manual (available as a PDF). Also disable A/D or any
other peripheral that shares the pins.

CCS is an interesting compiler, but you might consider the Hi-Tech or PICC
compilers too (some free demos).

I prefer to code the setup or initialization my self.

TRISA = 0B11111111; /* EMFD, EMF3, FLOW, EMFR, NA, QUES, TRGR, TRGD, TRG3 in */

TRISB = 0B00110011; /* IRI, KEY, IROD, FLSH, HALL, HALLT, D2, D3 */

ADCON0 = 0; /* A/D off */
ADCON1 = 6; /* all digital inputs */

CVRCON = 0; /* turn off compare modules */
CMCON = 7; /* 7 is power on reset, 0 kills PORTA */ Alan KM6VV Vincent wrote:

> Thank for this but that's not exactly what I need !
>
> I have no problem with the '628. I do anything I need in asm.
> My problem is not with the internal register and the way to use them...
> My problem is more related to CCS it self...
>
> How do you configure Inputs/Outputs ports in CCS ???
>
> Actually, I am trying to translate my asm code in C... But it's a fail for
> the moment because of IO malfuntions !!!
>
> If anyone has a snipet of code as a starting exemple, that would be
> sufficient !!
>
> Thanks for any helping hand !!
>
> Vincent >
>
> -----Original Message-----
> From: piclist@picl... [mailto:piclist@picl...] On Behalf Of
> rtstofer
> Sent: mercredi 31 août 2005 06:10
> To: piclist@picl...
> Subject: [piclist] Re: how do you make port a and B in or output in CCS ? > --- In piclist@picl..., "Vincent" <vincent.clerc@i...> wrote:
>
>>Hi all,
>>
>>working on a PIC16F628, I try to configure its I/O with pull-ups
>
> on B port
>
>>and set Input or output direction on port A and B...
>>
>>output_float(pin_A1);
>>output_float(pin_A2);
>>output_float(pin_A3);
>>output_float(pin_A5);
>>output_float(pin_A6);
>>output_float(pin_A7);
>>output_float(pin_B0);
>>output_float(pin_B6);
>>output_float(pin_B7);
>>
>>gives nothing...
>>
>>No mre than :
>>#use fixed_io(a_outputs=PIN_A4)
>>#use fixed_io(b_outputs=PIN_B1,PIN_B2,PIN_B3,PIN_B4,PIN_B5)
>>
>>
>>#USE STANDARD_IO(B)
>>#USE STANDARD_IO(A)
>>with
>> SET_TRIS_A( 0x10 ); // PORTA RA7-RA0 = Out Out Out In Out Out
>
> Out Out
>
>> SET_TRIS_B( 0xC1 ); // PORTB RB7-RB0 = In In Out Out Out Out Out
>
> In
>
>>
>>Can anyone help to clearly define what needs to be done ????
>>
>>By the way, any pointers to good documentation or tuts for CCS
>
> would be
>
>>great !!
>>The Help files is rather poor even if many exemples do well !!
>>
>>Thank a lot !
>>
>>Vince > One of the things that will bite you with the '628 is CMCON. By
> default, PORTA is analog.
>
> You should get the datasheet for the device and the Mid-Range MPU
> manual. >
> to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
>
> Yahoo! Groups Links >
> to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
> Yahoo! Groups Links





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )