[SOLVED] First Program - Problem

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times

[SOLVED] First Program - Problem

Post by dbasnett »

Trial Version of FlowCode - PIC16F88
EB006 - V6
SW2 - XTAL - CPU Config in FlowCode matches
Port A - EB004 - led matrix
Port B - EB005 - LCD
PSU power from the power supply in the EBX100 kit.

Modified the digital clock example program to output 5 bits of the seconds to port a. All seems to go well, but periodically (0 seconds, 4 seconds, 4 minutes 23 seconds, 1 hour 20 minutes 10 seconds, etc) the system seems to stop. There is no update of the time and pushing reset does nothing.

Running again as I type and up to about 10 minutes so far.

Double checked all connections. I am NOT using a separate ground wire.
Last edited by dbasnett on Fri Aug 19, 2011 1:49 pm, edited 1 time in total.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: First Program - Problem

Post by Spanish_dude »

Hi,

Could you upload your Flowcode file (*.fcf) ?
Also, if you made it with Flowcode v4 could you upload the C file (as I don't have flowcode v4) ?

BR,

Nicolas L. F.

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times

Re: First Program - Problem

Post by dbasnett »

Longest run so far, 6 hours 23 minutes 09 seconds. The changes I made to the example are in the Seconds and Displaytime macro. See attachment.
Attachments
5. Digital clock.c
C
(17.62 KiB) Downloaded 323 times
5. Digital clock.zip
FCF
(2.77 KiB) Downloaded 293 times

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: First Program - Problem

Post by Spanish_dude »

Hi,

I didn't find any errors in your C code.
I thought maybe your interrupt wasn't correctly set or the TMR0IF wasn't cleared but it all seems to be done.
I don't see something that you changed do that strange behavior.

Is your chip configuration correct ? (watchdog timer and stuff like that disabled)
Is your XT on board the same as the one you wrote in flowcode ?

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times

Re: First Program - Problem

Post by dbasnett »

Spanish_dude wrote:Hi,

I didn't find any errors in your C code.
I thought maybe your interrupt wasn't correctly set or the TMR0IF wasn't cleared but it all seems to be done.
I don't see something that you changed do that strange behavior.

Is your chip configuration correct ? (watchdog timer and stuff like that disabled)
Is your XT on board the same as the one you wrote in flowcode ?

Watchdog disabled. I don't know what 'XT' is.

The current run is still going at 2 hours +.

Before I restarted I turned the transformer off because I read something about an issue with just unplugging the power connector from the board, which is what I had been doing. I left the transformer at 13V and do have the correct plug with + outer.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Re: First Program - Problem

Post by JohnCrow »

Hi
With regard to the polarity of the power plug, I have mine with +ve outer, but it does not matter with the EB006. The bridge rectifier on the board means the co-ax power plug can be either +ve or -ve outer.

Where Nicolas refers to XT, I believe he means the crytal, (Personally I prefer to use XTAL)

The EB006 has a 19.6608 MHz crystal( Supplied default)
Goto
View / Project Options and check it has the same frequency set there (It should as that is the default)
Also check
Chip / Configure is set to XTAL

Was this the post you had read about issues pluging the power supply in.
Ive personally not had any problems with the 2 supplies I have.

http://www.matrixmultimedia.com/mmforum ... p?f=2&t=76
1 in 10 people understand binary, the other one doesn't !

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times

Re: First Program - Problem

Post by dbasnett »

That is the post. My power plug has the same polarity as you stated. At the power lugs (next to the PSU / USB jumper) I see +4.98V at both +V lugs, and 12.3V at the 14V lug.

View / Project Options Frequency = 19660800
Chip / Configure = XTAL checked.

Still running. Up to almost 5 hours.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: First Program - Problem

Post by Spanish_dude »

Hi,

Yes I meant XTAL :).

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times

Re: [SOLVED] First Program - Problem

Post by dbasnett »

I have marked this solved and think it is related to

http://www.matrixmultimedia.com/mmforum ... p?f=2&t=76

What I was doing was to unplug the connector from the board if I needed to power it off. What seems to have fixed the problem was to plug the transformer into a power strip with an on / off switch. When / if I needed to power off the board I flipped the switch on the power strip, turning off the power to the transformer and board.

Since then the program mentioned above has ran without fail. It is plus 12 hours and counting.

Post Reply