Converting a PIC DVM to output decimal

Thread Starter

Remembermyname

Joined Sep 6, 2015
91
Once the large order of LED's and 26K22 and 1826 come in, I will build the physical prototype and test it. I am learning more about the proteus software. It is a great piece of software and I am examining the MickroC software to learn more. The 46K22 can easily turn into an extensive fine test equipment albeit the project was a simple panel display. I can opt for the 46K22 version a little later once 26K22 is completed. I will post back on it's progress.

On one thought though, the physical input circuit that feeds the ADC will have to be designed with over voltage protection in mind, 300 and 600 VDC is incredibly high, but nothing is impossible. In most cases, the input is paralleled with a zener diode of a particular range (usually 5 VDC) to divert the signal to ground to avoid damaging the PIC input but also designed to signal an alert LED to tell the user that the voltage being read is too high or the software will cause all LED's to flash as a warning to the user of over range. I thank you greatly for your hard work and help in this matter.
 
Last edited:

Thread Starter

Remembermyname

Joined Sep 6, 2015
91
Hi,
Not yet, I'm still awaiting the arrival of the LED's in post. It's taking longer than usual. I do however already have the PIC18F26K22 and PIC16F1826 on standby. I can get a 46K22 if necessary so that all options are available.
 

Thread Starter

Remembermyname

Joined Sep 6, 2015
91
Sorry for the delays. The parts finally came in from China. The wait was painful. The prototype circuit has been built and can currently accommodate 1826 and a 26k22.
 

Thread Starter

Remembermyname

Joined Sep 6, 2015
91
Hello Jayanthd,
I attempted to complete the project but it appears that it didn't work as expected in proteus. I may have set something incorrectly and will get back on the project. I got side tracked on pressing matters as have you. I have all parts necessary including the prototyping circuit used for the test and will be back on this project again. I remember running the simulation in proteus and it appeared to have worked but haven't gotten to behave correctly since then. I will go back and start from the beginning and perhaps I can find what I did wrong. Thank you greatly for your help in this matter.
 

Thread Starter

Remembermyname

Joined Sep 6, 2015
91
I was using the same circuit that you originally posted. No changes. It is now working in Proteus but with some unpredictable results. The display irradically flickers and but stays above '000' when input is removed from the ADC. I am currently working to replace the three LED bars with 30 individual LEDs to see if this helps any. I do however, have the physical hardware circuit arranged and will need to send the hex to the MCU. When I last attempted this, it completed the writing without error but there was no response from the circuit. I am retracing my steps from the past to try this again to rule out any anomalies in my layout.
 
Your flickering may be that you don;t do inter-digit blanking. With a standard multiplesed display you have to turn OFF all of the digit drives briefly, then set the values for the next digit and set the next digit and then enable the digit,
 

Thread Starter

Remembermyname

Joined Sep 6, 2015
91
I have the hardware built. I attempted to program the 46k22 using a JDM programmer. The write ends in verify error. I have attempted different serial baud rates(9600, 4800, 2400) but with the same results. No errors were encountered using the 26k22. I am running PICpgm (Linux) to run the programmer. Has anyone else experienced this problem? Even though the programming completed, I installed the PIC into the circuit to attempt to run it but with no reaction when power is applied. Perhaps a missed ground pin or something. I was certain it was connected correctly but will have to verify deeper.
 

jayanthd

Joined Jul 4, 2015
945
I have the hardware built. I attempted to program the 46k22 using a JDM programmer. The write ends in verify error. I have attempted different serial baud rates(9600, 4800, 2400) but with the same results. No errors were encountered using the 26k22. I am running PICpgm (Linux) to run the programmer. Has anyone else experienced this problem? Even though the programming completed, I installed the PIC into the circuit to attempt to run it but with no reaction when power is applied. Perhaps a missed ground pin or something. I was certain it was connected correctly but will have to verify deeper.
Please build the circuit on a PCB.
 

Thread Starter

Remembermyname

Joined Sep 6, 2015
91
The display head is on a PCB. The 46k22 is breadboarded in case it needs to be removed to be reprogrammed. Jumpers connect the 46k22 to the display head. Please elaborate.
 

jayanthd

Joined Jul 4, 2015
945
Test the code which was given for 3 digits. You should get a stable 3 digit display. If it works then I will make the code for your 10 digits and for floating point values.

Do you have the Compiler to Compile my code. If I had given code for 18F26K22 then in mikroC PRO PIC's Edit Project dialog box check the settings I have set and use the same settings after changing the MCU to 18F46K22 and compile the code and try.
 

Thread Starter

Remembermyname

Joined Sep 6, 2015
91
I do have the MikroC Pro compiler. The last code that you posted on 10 September 2015 was labeled as PIC18F46K22. I will check the config bits and try again.
 

Thread Starter

Remembermyname

Joined Sep 6, 2015
91
I went back over this but didn't find any code posted for pic18f26k22 but I did manage load the last pic18f46k22 project into MikroC Pro and examine the configuration bits:

Settings for PIC18F46K22:

Oscillator Selection:
HS osc (hi power > 16 MHz

4x PLL enable:
disabled

Primary lock enable bit:
enabled

Fail-Safe clock monitor:
disabled

Internal/External Oscillator Switchover:
disabled

Power-up Timer:
disabled

Brown-out Reset:
Brown-out Reset enabled in hardware only (SBOREN is disabled)

Brown-out Reset Voltage:
VBOR set to 1.90 V nominal

Watchdog Timer:
disabled

Watchdog Timer Portscale:
1:32768

CCP2 MUX bit:
CCP2 input/output is multiplexed with RC1

PORTB A/D:
enabled

P3A/CCP3 Mux bit:
P3A/CCP input/output is multiplexed with RE0

HFINTOSC Fast Start-up:
enabled

Timer3 Clock input mux:
T3CKI is on RC0

ECCP2 B output mux:
P2B is on RD2

MCLR pin:
RE3 input pin enabled; MCLR disabled

Stack Full/Unerflow Reset:
enabled

Low Voltage Program:
disabled

Extended Instruction Set:
disabled

Extended Instruction Set:
disabled

Background Debug:
disabled

Code Protection Block 0:
disabled

Code Protection Block 1:
disabled

Code Protection Block 2:
disabled

Code Protection Block 3:
disabled

Boot Block Code Protection:
disabled

Data EEPROM Code Protection:
disabled

Write Protection Block 0:
disabled

Write Protection Block 1:
disabled

Write Protection Block 3:
disabled

Configuration Register Write Protection:
disabled

Boot Block Write Protection:
disabled

Data EEPROM Write Protection:
disabled

Table Read Protection Block 0:
disabled

Table Read Protection Block 1:
disabled

Table Read Protection Block 2:
disabled

Table Read Protection Block 3:
disabled

Boot Block Table Read Protection:
disabled

Configuration Registers:
CONFIG1H : $300001 : 0x0020
CONFIG2L : $300002 : 0x001F
CONFIG2H : $300003 : 0x003C
CONFIG3H : $300005 : 0x003B
CONFIG4L : $300006 : 0x0081
CONFIG5L : $300008 : 0x000F
CONFIG5H : $300009 : 0x00C0
CONFIG6L : $30000A : 0x000F
CONFIG6H : $30000B : 0x00E0

I've found that my power connection to the PIC was flawed and have corrected it. However, when I power up the hardware, all 30 LEDs are constant on with no further action.
 
Top