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 | 16f84 / 16f88 port a differences

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.

Floating Analog input - Phil Keller - Aug 9 11:06:00 2005

I am trying to take an analog signal (out of an MP3 player) and
determine its relative signal amplitude with the PIC's A2D input. I
would like to keep the sampling frequency down (to reduce the clock
speed and save power) so I thought of adding a large cap outside the
PIC in parallel with a resistor to ground to form a peak detector.

The problem is that the manufacture spec says that I must never
connect Audio ground to Digital Ground.

I thought of simply having the analog input across a resistor to
analog ground and using a blocking cap to couple the signal to the
base of a PNP (The base is DC biased to Vcc/2 and the Collector to
digital ground) with a diode on the emitter to the PIC and large Cap &
resistor to digital ground.

I tried this with Linear Technology's LTspice and the results were
very ugly.

I am sure that this has been done before but I have been unable to
find anything via Google or in the PIClist archives. The right
keywords have escaped me so far.

All suggestion, pointers, ideas or answers are gratefully appreciated.

Phil




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


Re: Floating Analog input - Paul Harrison - Aug 9 11:24:00 2005

I had to do something similar recently - looking at the headphone output
of a player. I used a small audio transformer to isolate (I couldn't be
sure of the ground loop possibilities) and a bridge rectifier to supply
positive voltage to the pic a/d input - worked great. Just had to
adjust the filter cap to get the audio response I needed.

Paul

Phil Keller wrote:

>I am trying to take an analog signal (out of an MP3 player) and
>determine its relative signal amplitude with the PIC's A2D input. I
>would like to keep the sampling frequency down (to reduce the clock
>speed and save power) so I thought of adding a large cap outside the
>PIC in parallel with a resistor to ground to form a peak detector.
>
>The problem is that the manufacture spec says that I must never
>connect Audio ground to Digital Ground.
>
>I thought of simply having the analog input across a resistor to
>analog ground and using a blocking cap to couple the signal to the
>base of a PNP (The base is DC biased to Vcc/2 and the Collector to
>digital ground) with a diode on the emitter to the PIC and large Cap &
>resistor to digital ground.
>
>I tried this with Linear Technology's LTspice and the results were
>very ugly.
>
>I am sure that this has been done before but I have been unable to
>find anything via Google or in the PIClist archives. The right
>keywords have escaped me so far.
>
>All suggestion, pointers, ideas or answers are gratefully appreciated.
>
>Phil >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 )

16f84 / 16f88 port a differences - Lez - Aug 9 15:53:00 2005


Built the 2 resistor serial link as shown in some pic basic PDF files,
and I have had no problem with the 16f84 (1k for pic serout, 22k for serin)

re-compiled the program for a 16f88, plugged chip in, data from chip to
PC is ok but data from PC to chip is not being seen by the PIC.

I have led's on the lines, both led's glow when data is moving, and
typing on the PC keyboard flashed the LED, but the pic does nothing.

Resistor change? more / less value ?
Tried a wet finger it changes the led brightnes so I must be missing
something else about this port.

Also tried a 648a and a 628a, both do same as f88.

I am receiving data on a.0, sending data back to the pc on a.1

I use a.2 as a 'ready to receive' led and that is fine.
I use a.3 as a 'ready and powered' led and that is not coming on at
all(except on the f84)

led's have a 1k resistor to gnd I thought the f88 and f84 were 'compatible' ?

Quit and buy more 16f84's ?





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

Re: 16f84 / 16f88 port a differences - smxcu - Aug 9 16:26:00 2005

--- In piclist@picl..., Lez <lez.briddon@n...> wrote:
>
> Built the 2 resistor serial link as shown in some pic basic PDF files,
> and I have had no problem with the 16f84 (1k for pic serout, 22k for
serin)
>
> re-compiled the program for a 16f88, plugged chip in, data from chip to
> PC is ok but data from PC to chip is not being seen by the PIC.
>
> I have led's on the lines, both led's glow when data is moving, and
> typing on the PC keyboard flashed the LED, but the pic does nothing.
>
> Resistor change? more / less value ?
> Tried a wet finger it changes the led brightnes so I must be missing
> something else about this port.
>
> Also tried a 648a and a 628a, both do same as f88.
>
> I am receiving data on a.0, sending data back to the pc on a.1
>
> I use a.2 as a 'ready to receive' led and that is fine.
> I use a.3 as a 'ready and powered' led and that is not coming on at
> all(except on the f84)
>
> led's have a 1k resistor to gnd > I thought the f88 and f84 were 'compatible' ?
>
> Quit and buy more 16f84's ?

The porta pins that you are using are also used by the A/D converter.
You need to ensure that they are configured as digital I/O and not
analog inputs. Check the data sheets.

Regards
Sergio Masci

http://www.xcprod.com/titan/XCSB - optimising PIC compiler
FREE for personal non-commercial use
.





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

RE: 16f84 / 16f88 port a differences - Alan Marconett - Aug 9 17:00:00 2005

Hi Lez,

Had that happen to me on the '877. ADCON0 = 0; /* A/D off */
ADCON1 = 6; /* all digital inputs */

HELPS! The A/D defaults ON. Another pair that got me:

CVRCON = 0; /* turn off compare modules */
CMCON = 7; /* 7 is power on reset, */

Although these are defaults, and can probably be ignored. I inadvertently
set CMCON = 0, thinking to turn 'em off, but that was wrong!

'88 has these registers, but I don't know off hand if these are the same in
an '877.

Alan KM6VV
> -----Original Message-----
> From: piclist@picl... [mailto:piclist@picl...] On Behalf
> Of Lez
> Sent: Tuesday, August 09, 2005 12:53 PM
> To: piclist@picl...
> Subject: [piclist] 16f84 / 16f88 port a differences > Built the 2 resistor serial link as shown in some pic basic PDF files,
> and I have had no problem with the 16f84 (1k for pic serout, 22k for
> serin)
>
> re-compiled the program for a 16f88, plugged chip in, data from chip to
> PC is ok but data from PC to chip is not being seen by the PIC.
>
> I have led's on the lines, both led's glow when data is moving, and
> typing on the PC keyboard flashed the LED, but the pic does nothing.
>
> Resistor change? more / less value ?
> Tried a wet finger it changes the led brightnes so I must be missing
> something else about this port.
>
> Also tried a 648a and a 628a, both do same as f88.
>
> I am receiving data on a.0, sending data back to the pc on a.1
>
> I use a.2 as a 'ready to receive' led and that is fine.
> I use a.3 as a 'ready and powered' led and that is not coming on at
> all(except on the f84)
>
> led's have a 1k resistor to gnd > I thought the f88 and f84 were 'compatible' ?
>
> Quit and buy more 16f84's ?




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

Re: 16f84 / 16f88 port a differences - upand_at_them - Aug 9 18:39:00 2005

To make the 16F88 behave like the 16F84 you just have to disable the
analog functions.

In Assembly:
banksel cmcon
movlw 7
movwf cmcon
clrf ansel
banksel porta

In some high-level language:
CMCON = 7
ANSEL = 0 Mike --- In piclist@picl..., Lez <lez.briddon@n...> wrote:
>
> Built the 2 resistor serial link as shown in some pic basic PDF
files,
> and I have had no problem with the 16f84 (1k for pic serout, 22k
for serin)
>
> re-compiled the program for a 16f88, plugged chip in, data from
chip to
> PC is ok but data from PC to chip is not being seen by the PIC.
>
> I have led's on the lines, both led's glow when data is moving, and
> typing on the PC keyboard flashed the LED, but the pic does nothing.
>
> Resistor change? more / less value ?
> Tried a wet finger it changes the led brightnes so I must be
missing
> something else about this port.
>
> Also tried a 648a and a 628a, both do same as f88.
>
> I am receiving data on a.0, sending data back to the pc on a.1
>
> I use a.2 as a 'ready to receive' led and that is fine.
> I use a.3 as a 'ready and powered' led and that is not coming on at
> all(except on the f84)
>
> led's have a 1k resistor to gnd > I thought the f88 and f84 were 'compatible' ?
>
> Quit and buy more 16f84's ?





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