Okada
Banned
Is it good to use ULN2003 for driving 7 Segment Displays ?
I am reverse engineering a circuit. I have the original .hex file of the product. It works well on hardware and also Proteus. I have videos of it. I have written a code for that product but my code is causing the display to flicker. My code is correct. I have used 500 us interrupt for refreshing the 6 digit common cathode display. My code is working fine in Proteus but flickers in hardware.
Client has asked not to post code and hence I can't post full code but if needed I can post ISR code which is used to drive the displays. I am using PIC16F73. The device is called a Device Protector. It cuts off mains if voltage is beyond under / Over voltage limits. It also displays input and output voltage on 2x 3 digit 7 Segment displays.
In the real hardware they have used ULN2003 to drive both 7 Segment displays and relay. I told it is bad to use ULN2003 as it can't switch faster. I told to use BC547 for both 7 Segment displays and relay driving.
Here is the ISR code.
Edit:
I can't post the .hex file because the device doesn't have internal eeprom and without eeprom I can't create demo .hex file. I am attaching Proteus simulation videos of my .hex file.
These are the links to videos of hardware working of the original product with original .hex files.
**broken link removed**
**broken link removed**
You can see that there is no flickering of displays but also you can see how badly the code is written because when initially Lo is displayed it also tries to display countdown timer and display flickers and fluctuates.
I am reverse engineering a circuit. I have the original .hex file of the product. It works well on hardware and also Proteus. I have videos of it. I have written a code for that product but my code is causing the display to flicker. My code is correct. I have used 500 us interrupt for refreshing the 6 digit common cathode display. My code is working fine in Proteus but flickers in hardware.
Client has asked not to post code and hence I can't post full code but if needed I can post ISR code which is used to drive the displays. I am using PIC16F73. The device is called a Device Protector. It cuts off mains if voltage is beyond under / Over voltage limits. It also displays input and output voltage on 2x 3 digit 7 Segment displays.
In the real hardware they have used ULN2003 to drive both 7 Segment displays and relay. I told it is bad to use ULN2003 as it can't switch faster. I told to use BC547 for both 7 Segment displays and relay driving.
Here is the ISR code.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 PORTC &= 0x80; switch(digit) { case 0: if(digits[0] != 0) { SSD_DATA_PORT = digits[0]; PORTC = 0x20; } break; case 1: SSD_DATA_PORT = digits[1]; PORTC = 0x10; break; case 2: SSD_DATA_PORT = digits[2]; PORTC = 0x08; break; case 3: if(digits[3] != 0x3F) { SSD_DATA_PORT = digits[3]; PORTC = 0x04; } break; case 4: SSD_DATA_PORT = digits[4]; PORTC = 0x02; break; case 5: SSD_DATA_PORT = digits[5]; PORTC = 0x01; break; }; if(++digit >= 6) { digit = 0; } TMR1IF_bit = 0; TMR1H = 0xFE; TMR1L = 0x0C;
Edit:
I can't post the .hex file because the device doesn't have internal eeprom and without eeprom I can't create demo .hex file. I am attaching Proteus simulation videos of my .hex file.
These are the links to videos of hardware working of the original product with original .hex files.
**broken link removed**
**broken link removed**
You can see that there is no flickering of displays but also you can see how badly the code is written because when initially Lo is displayed it also tries to display countdown timer and display flickers and fluctuates.
Attachments
Last edited: