I connect a button to int b0 for interrupt and 4 digit 7 segment led on b1-b7 for segment a-g and leave dot segment unconnect.
I found the flowcode simulator work properly but not in real hardware. Please advice.
16f88 / 16f628 int b0 with 7segment on port b
Moderator: Benj
- DavidA
- Matrix Staff
- Posts: 1076
- Joined: Fri Apr 23, 2010 2:18 pm
- Location: Matrix Multimedia Ltd
- Has thanked: 58 times
- Been thanked: 258 times
- Contact:
Re: 16f88 / 16f628 int b0 with 7segment on port b
Hello,
Please see this post from Martin about issues with hardware.
http://www.matrixmultimedia.com/mmforum ... =26&t=6936
Also if you still have problems, you will need to be a bit more descriptive about your problem, ie, what version of Flowcode you use, what chip you are programming, what the target hardware is (Eblocks? Arduino? Custom hardware?), also other details like clock speed etc.
A good practice is to do a 1s flasher program to ensure your clock speed is correct.
Please see this post from Martin about issues with hardware.
http://www.matrixmultimedia.com/mmforum ... =26&t=6936
Also if you still have problems, you will need to be a bit more descriptive about your problem, ie, what version of Flowcode you use, what chip you are programming, what the target hardware is (Eblocks? Arduino? Custom hardware?), also other details like clock speed etc.
A good practice is to do a 1s flasher program to ensure your clock speed is correct.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: 16f88 / 16f628 int b0 with 7segment on port b
It's happening because in 7 segment component code is written in this way that whole port is for 7 segment 0-7 bit sequentially. Have you noticed in simulation whether you put 0 or 1 in decimal point but dp always on...
This is because of array declared in the c code..
This is because of array declared in the c code..
Code: Select all
ROMARRAY_S SEVENSEG4_1_SegmentArray ROMARRAY_E = {192, 249, 164, 176, 153, 146, 130, 248, 128, 152}; //Create ROM pattern array for the display
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: 16f88 / 16f628 int b0 with 7segment on port b
Hi,
Although my last post wasn't not wrong but there is no solution there. I have tried to test your problem in single segment as the case is same for single and 4 segment. But testing is easier in single segment.. I got the problem...Actually although you left DP unconnected but FC doesn't leave it unconnected..proof is..
you see both 6 and 7 pin connected to bit 7...that causing the problem and the solution is you have to edit your component code...
First of all..as you are not using DP..disable that code...
If you put decimal point as 0 this bit of code is normally ignored...but for safety disable this..
But the main problem is causing by..
Disable this portion of code...
and also
I am posting here new c code for component 7seg...you have to backup your own in the component folder of FCV5 and use the attached one..If you get this one nice and working, you can edit your 4segment component or tell me to do that.
Although my last post wasn't not wrong but there is no solution there. I have tried to test your problem in single segment as the case is same for single and 4 segment. But testing is easier in single segment.. I got the problem...Actually although you left DP unconnected but FC doesn't leave it unconnected..proof is..
Code: Select all
#define SEVENSEG1_1_SEG_PORT portb
#define SEVENSEG1_1_SEG_TRIS trisb
#define SEVENSEG1_1_COM_PORT porta
#define SEVENSEG1_1_COM_TRIS trisa
#define SEVENSEG1_1_SEG_PIN0 1
#define SEVENSEG1_1_SEG_PIN1 2
#define SEVENSEG1_1_SEG_PIN2 3
#define SEVENSEG1_1_SEG_PIN3 4
#define SEVENSEG1_1_SEG_PIN4 5
#define SEVENSEG1_1_SEG_PIN5 6
#define SEVENSEG1_1_SEG_PIN6 7
#define SEVENSEG1_1_SEG_PIN7 7
#define SEVENSEG1_1_COM_PIN 0
#define SEVENSEG1_1_COM_TYPE 0
First of all..as you are not using DP..disable that code...
Code: Select all
// if (DecimalPoint)
// cSegmentValue = cSegmentValue & 0x7F; //Clear decimal point bit
But the main problem is causing by..
Code: Select all
// if (cSegmentValue & 0x80)
// {
// FC_CAL_Bit_High_DDR(SEVENSEG1_1_SEG_PORT, SEVENSEG1_1_SEG_TRIS, SEVENSEG1_1_SEG_PIN7);
// }
// else
// {
// FC_CAL_Bit_Low_DDR(SEVENSEG1_1_SEG_PORT, SEVENSEG1_1_SEG_TRIS, SEVENSEG1_1_SEG_PIN7);
// }
and also
Code: Select all
// if (cSegmentValue & 0x80)
// {
// FC_CAL_Bit_Low_DDR(SEVENSEG1_1_SEG_PORT, SEVENSEG1_1_SEG_TRIS, SEVENSEG1_1_SEG_PIN7);
// }
// else
// {
// FC_CAL_Bit_High_DDR(SEVENSEG1_1_SEG_PORT, SEVENSEG1_1_SEG_TRIS, SEVENSEG1_1_SEG_PIN7);
// }}
- Attachments
-
- 7seg.fcf
- (8 KiB) Downloaded 275 times
-
- FC5_PIC_7seg.c
- modified for pic16f628 with RB1-7
- (7.85 KiB) Downloaded 270 times
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: 16f88 / 16f628 int b0 with 7segment on port b
Hi Enamuel!
This 7seg.c is this a fix for 5.4 wich you recommend to update
Hope I'm not too irritating and asking to much, otherwise tell me. But I want to have the perfect FC as possible. I am not able to look deeper into the "stomach" of FC as you are. I am only a user of FC. .
Best regard
Jorgen
This 7seg.c is this a fix for 5.4 wich you recommend to update

Hope I'm not too irritating and asking to much, otherwise tell me. But I want to have the perfect FC as possible. I am not able to look deeper into the "stomach" of FC as you are. I am only a user of FC. .
Best regard
Jorgen
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: 16f88 / 16f628 int b0 with 7segment on port b
Hi Jorgan,
No problem in asking. You are always welcome. No this is not general fix. It is for those who want to use 7segment in portb from 1 to 7 and bit 0 for other purpose and they will not use dp.. As currently you have to connect a,b,c,d,e,f,g,dp in bit 0-7.
No problem in asking. You are always welcome. No this is not general fix. It is for those who want to use 7segment in portb from 1 to 7 and bit 0 for other purpose and they will not use dp.. As currently you have to connect a,b,c,d,e,f,g,dp in bit 0-7.
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
Re: 16f88 / 16f628 int b0 with 7segment on port b
Hi ,hi, you are quickly Enamuel, Ok I understand - Thank´s
Jorgen

Jorgen