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

Discussion Groups

Discussion Groups | Piclist | Re: 16F628

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.

16F628 - Author Unknown - May 29 10:36:00 2004


I want to use PortA.2 on the 628 for a serin.  Do I write:

TRISA = %00000000

Do I have to set CMCON?

Thanks

Sid





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

16F628 - Author Unknown - May 30 18:27:00 2004

Since no one responded, I'll post it gain.  Maybe this time .............. I want to use PortA.2 on the 628 for a serin.  Do I write:

TRISA = %00000000

Do I have to set CMCON?

Sid







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

RE: 16F628 - Scott Thompson - May 30 18:36:00 2004

Set the bits in TRISA to 1's if you want them to be inputs.  Therefore, to set PortA.2, you would use TRISA=%00000100.
 
Best,
Scotty
 
 
----- Original Message -----
From:
To: p...@yahoogroups.com
Sent: 5/30/2004 16:27:52
Subject: [piclist] 16F628

Since no one responded, I'll post it gain.  Maybe this time ..............I want to use PortA.2 on the 628 for a serin.  Do I write:

TRISA = %00000000

Do I have to set CMCON?

Sid




to unsubscribe, go to http://www.yahoogroups.com and follow the instructions




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

Re: 16F628 - Leon Heller - May 30 23:11:00 2004

----- Original Message -----
From:
To:
Sent: Monday, May 31, 2004 12:27 AM
Subject: [piclist] 16F628 Since no one responded, I'll post it gain. Maybe this time .............. I want to use PortA.2 on the 628 for a serin. Do I write:

TRISA = %00000000

Do I have to set CMCON?

Read page 82 of the PIC16F62x data. It's some time since I've done it, but
it worked OK.

Leon
--
Leon Heller, G1HSM
http://www.geocities.com/leon_heller






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

Re: 16F628 - rtstofer - May 31 0:02:00 2004


If, by 'serin' you mean a serial input to the USART then that would
be on PORT B. If you want to 'bit-bang' a serial input then you can
use any input bit.

Setting TRISA to 0x00 would set all bits as output - probably not
what you want.

Yes, you do need to deal with CMCON when using PORT A. There are
examples in the PIC62x datasheet, specifically example 5-1.

You might look at figure 9-1 for information about PORTA and CMCON.
Specifically the low order 3 bits need to be '1' if you plan to use
the port for digital IO

Chapter 12 deals with the USART. --- In , Newzed@a... wrote:
> Since no one responded, I'll post it gain. Maybe this
time .............. > I want to use PortA.2 on the 628 for a serin. Do I write:
>
> TRISA = %00000000
>
> Do I have to set CMCON?
>
> Sid




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

Re: Re: 16F628 - Author Unknown - May 31 8:01:00 2004

In a message dated 5/31/2004 1:03:16 AM Eastern Daylight Time, r...@pacbell.net writes:


Yes, you do need to deal with CMCON when using PORT A.  There are
examples in the PIC62x datasheet, specifically example 5-1.

You might look at figure 9-1 for information about PORTA and CMCON. 
Specifically the low order 3 bits need to be '1' if you plan to use
the port for digital IO


Thanks, rstofer.

Fig. 9-1 was what I was looking for.  Must have passed over it first time thru the data sheet.  Example 5-1 is in assembly so that is Greek to me but I did note the 0x07.  I did a program for the 628 a long time ago and CMCON = 7 sounded very familiar.

Thanks again.

Sid




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

Re: 16F628 - Allan Lane - May 31 20:49:00 2004

Yes, I believe you do have to set CMCON to
0x07, if you want to use the comparator pins as
digital inputs.

I ran into this on the 12F629, and it was very
irritating.

--- In , "Leon Heller" <leon_heller@h...>
wrote:
> ----- Original Message -----
> From: Newzed@a...
> To:
> Sent: Monday, May 31, 2004 12:27 AM
> Subject: [piclist] 16F628 > Since no one responded, I'll post it gain. Maybe this
time .............. > I want to use PortA.2 on the 628 for a serin. Do I write:
>
> TRISA = %00000000
>
> Do I have to set CMCON?
>
> Read page 82 of the PIC16F62x data. It's some time since I've done
it, but
> it worked OK.
>
> Leon
> --
> Leon Heller, G1HSM
> http://www.geocities.com/leon_heller




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

16F628 - Author Unknown - Nov 17 16:17:00 2004

I need to use PortA.4 for a serout, but it doesn't seem to be working.  I wrote:
CMCON = 7

Is there anything else I need to do?  Serout makes the pin an output so I'm not concerned about direction.

Sid





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

Re: 16F628 - rtstofer - Nov 17 18:07:00 2004



Ordinarily the Tx pin is on PORTB.2 and Rx is on PORTB.1. Look back
a few threads - we have been discussing the 16F628 all week. Code,
known to work, is posted. --- In , Newzed@a... wrote:
> I need to use PortA.4 for a serout, but it doesn't seem to be
working. I
> wrote:
> CMCON = 7
>
> Is there anything else I need to do? Serout makes the pin an
output so I'm
> not concerned about direction.
>
> Sid





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

Re: Re: 16F628 - Author Unknown - Nov 17 18:20:00 2004

In a message dated 11/17/2004 6:18:33 PM Eastern Standard Time, r...@pacbell.net writes:


Ordinarily the Tx pin is on PORTB.2 and Rx is on PORTB.1.  Look back
a few threads - we have been discussing the 16F628 all week.  Code,
known to work, is posted.


I have to use PortA.4.  It is the only pin available.  Can't I use it for serout?

Sid





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

Re: 16F628 - rtstofer - Nov 17 19:21:00 2004


--- In , Newzed@a... wrote:
> In a message dated 11/17/2004 6:18:33 PM Eastern Standard Time,
> rstofer@p... writes: > > Ordinarily the Tx pin is on PORTB.2 and Rx is on PORTB.1. Look back
> > a few threads - we have been discussing the 16F628 all week. Code,
> > known to work, is posted.
> >
>
> I have to use PortA.4. It is the only pin available. Can't I use
it for
> serout?
>
> Sid]

I guess you can but it will be bit-banged, not from the on-chip USART.
I don't know if it will matter but PORTA.4 is an open-drain output.
You will need to pull it up with a resistor. If you plan to wiggle it
then you will need to define it as an output.

You didn't say what language you were using and I don't know if the
one you are using provides bit-banged serial IO. I imagine some do
but I don't have any experience doing this.





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

Re: 16F628 - jrem - Nov 17 19:35:00 2004


Sid: I think you're thinking stamps . . . the 16f628 only does tx
on RB1 (or whatvever), mr. stofer is correct.

I think the stamp authors wrote some routines to bit-bang serial com
out any port, because I know the stamp you can change the output pin.

You will need to change your pins around so you free up the right
pin, and change your code to match. Or stay with the stamp, it's a
pretty good deal. Or try the picaxe, I just got one in from mr.
anderson (en?), do a google search, he sells stuff on the cheap. The
picaxe has a bootloader and special pc software to do the deal like
the stamp but not through eprom, check it out.
--- In , Newzed@a... wrote:
> In a message dated 11/17/2004 6:18:33 PM Eastern Standard Time,
> rstofer@p... writes: > > Ordinarily the Tx pin is on PORTB.2 and Rx is on PORTB.1. Look
back
> > a few threads - we have been discussing the 16F628 all week.
Code,
> > known to work, is posted.
> >
>
> I have to use PortA.4. It is the only pin available. Can't I use
it for
> serout?
>
> Sid





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