hello
in an existing environment i want replace a 16C58 with an 16F628A. originally at the CLKIN (RA7) there was an potentiometer. how can i read in analog this pin and must configure them?
thanks for an idea and greetings
hello
in an existing environment i want replace a 16C58 with an 16F628A. originally at the CLKIN (RA7) there was an potentiometer. how can i read in analog this pin and must configure them?
thanks for an idea and greetings
Use POT or RCTIME statement. Must add an external capacitor prior to make it work. Input must be set to analog too. CMCON=7.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
thanks for the information, unfortunalety it doesn't run...
can you tell my link where CNCOM is described online?can't find a good information
POT and RCTIME are described in the PBP Compiler Manual, but im not sure if my code is arranged right
could you tell me a short example in PBP?
thank you very much
this one comes from Melabs code example
in the PBP you have also one code example for POT and the according schematic. BTW if you don't have any book on hand, they provide one onlineCode:' PicBasic Pro program to read pot and display on LCD ' Define LCD pins Define LCD_DREG PORTA Define LCD_DBIT 0 Define LCD_RSREG PORTA Define LCD_RSBIT 4 Define LCD_EREG PORTB Define LCD_EBIT 3 ' Allocate variables x var byte CMCON = 7 ' Set PORTA to digital Pause 100 ' Wait for LCD to start mainloop: Pot PORTB.0, 127, x Lcdout $fe, 1, "pot=", #x ' Send value to LCD Pause 100 ' Do it about 10 times a second Goto mainloop ' Do it forever End
pdf:
http://www.melabs.com/downloads/pbpm304.pdf
Html:
http://microengineeringlabs.com/resources/pbpmanual
CMCON is the register for analog comparator of the PIC16F628. You'll find it in the datasheet section 9.0
datasheet:
http://ww1.microchip.com/downloads/e...Doc/40300c.pdf
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks