PDA

View Full Version : I2C Slave, config Vref - + in pic with ADC



sebapostigo
- 4th March 2007, 00:23
I like make a system with I2C, but only can programm a master PIC, existe some code for create a slave, but i very big (ass segment code included)

Other recourse i need is config Voltage references + and -, in (for example) PIC16f877

mister_e
- 4th March 2007, 00:31
for the I2C slave routine, you could start with those on the melabs website
http://www.melabs.com/resources/samples.htm
I2Cmast.bas
I2Cslave.bas

for the voltage reference... for ADC or analog comparator?

sebapostigo
- 4th March 2007, 20:07
Thank, but is good use only one command




for the voltage reference... for ADC or analog comparator?

the comparator of 16f877

mister_e
- 4th March 2007, 20:15
Thank, but is good use only one command
not sure if i follow you. Could you explain it a little it more?

For the 877, there's no analog comparator, only the 877A will have it.

If you want to know the possible values , use my PicMultiCalc
http://www.mister-e.org/pages/utilitiespag.html

once done is just a matter to read a little bit the datasheet in the analog comparator section, register CMCON and CVRCON

sebapostigo
- 5th March 2007, 04:21
La verdad me complica un poco exponer esto en ingles:

deseo saber como puedo configurar los pines 4 y 5 del PIC 16f877a para q funcionene como referencias de voltaje y no como entradas analogas, en general se como definir una entrada si es I/O, pero cuando tiene otras funciones me complica un poco es especial este caso, ya que no basta con definirlas como entrada-salida, si no tambien como entrada analoga o entrada de referencia

GOOOGLE TRASLATION:
The truth is difficult a little to expose this in English:
desire to know as I can form pins 4 and 5 of the PIC 16f877a for q funcionene like references of voltage and not like analogous entrances, in general like defining an entrance if it is I/O, but when it has other functions complica me a little is special east case, since it is not enough with defining them like entrance-exit, if not also like analogous entrance or entrance of reference