TRISC.7 = 0 'Set PORTC.7 to output - amplifier range output. TRISC.6 = 0 'Set PORTC.6 to output - current sensor range output. TRISC.5 = 1 'Set PORTC.5 to input - CAL switch input TRISC.2 = 0 'Set PORTC.2 to output - PWM signal for 0.1V/A analog output. TRISC.0 = 1 'Set PORTC.0 to input - A/D input Here's my test code, totally stripped down for debugging:ĭEFINE FOSC = HFINTOSC 'Internal clock.ĭEFINE IRCF = %1111 'Set internal clock to 16 MHz. While I expected to have some issues with the port, I'm out of ideas with a few compiler warnings. SameĮxact pinout, more memory, but most important, the 16F1509 has an internal voltage reference for the A/D. No microcontroller expert here, but I made it work. Necessary, scale and parse the value, and send to a LCD display. It's a high current, high frequency ammeter - read a DC value with the A/D converter, change ranges as I recently designed a piece of test equipment using a 16F690. Hopefully this won't be posted twice - the first time was before I was fully registered.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |