EEPROM Question
-
- Posts: 128
- Joined: Wed Jul 04, 2012 11:21 pm
- Location: Greece
- Has thanked: 51 times
- Been thanked: 19 times
- Contact:
EEPROM Question
Hi, that's my first post here so excuse me for any mistake and for my poor English as well.
I am working on a project using a MCU PIC 16f628A to control two dosing pumps.
Using the Flowcode 4 software i have programmed the PIC micro controller.
The problem i am facing is regarding the EEPROM as i mentioned on the title of the topic.
I write a variable to the EEPROM , then i turn the power off and then again on but the variable i get in the same adress is not the same with the saved variable. I guess that the EEPROM doesn't save the variable properly and that is the reason that i ask your help.
Is there anything that i should do to face that issue ?
Thanks in advance !
George
I am working on a project using a MCU PIC 16f628A to control two dosing pumps.
Using the Flowcode 4 software i have programmed the PIC micro controller.
The problem i am facing is regarding the EEPROM as i mentioned on the title of the topic.
I write a variable to the EEPROM , then i turn the power off and then again on but the variable i get in the same adress is not the same with the saved variable. I guess that the EEPROM doesn't save the variable properly and that is the reason that i ask your help.
Is there anything that i should do to face that issue ?
Thanks in advance !
George
- petesmart
- Valued Contributor
- Posts: 395
- Joined: Thu May 06, 2010 11:42 am
- Location: Sydney, Australia
- Has thanked: 187 times
- Been thanked: 140 times
- Contact:
Re: EEPROM Question
Hi George,
I seem to recall have an issue with location zero on the EEprom... try using another location..... location one or two for example
see how you go
all the best
Pete
I seem to recall have an issue with location zero on the EEprom... try using another location..... location one or two for example
see how you go
all the best
Pete
sorry about that Chief!
-
- Posts: 128
- Joined: Wed Jul 04, 2012 11:21 pm
- Location: Greece
- Has thanked: 51 times
- Been thanked: 19 times
- Contact:
Re: EEPROM Question
Hi Pete, you gave me an answer that i am looking for three days now.
Thank you very much for your answer!!!!!
PROBLEM SOLVED: ADDRESS 0 of EEPROM is not recommended for use.
Regards
George
Thank you very much for your answer!!!!!
PROBLEM SOLVED: ADDRESS 0 of EEPROM is not recommended for use.
Regards
George
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: EEPROM Question
Hi,
I was using 0th location as an indicator for writing some data in EEPROM but if we turn off-on power and try to read the location which we have already written...we don't get that bcz it seems to me now 0 th address goes wrong which tells PIC nothing written.
Is that a PIC IC issue or FC issue?
Enamul
Are you saying that in some PIC we might have problem in using 0th address of EEPROM? Because in my one project I have used 16f876 I have seen this kind of problem not with all PIC but with some PIC (may be hardware problem I thought)..I seem to recall have an issue with location zero on the EEprom... try using another location.....
I was using 0th location as an indicator for writing some data in EEPROM but if we turn off-on power and try to read the location which we have already written...we don't get that bcz it seems to me now 0 th address goes wrong which tells PIC nothing written.
Is that a PIC IC issue or FC issue?
Enamul
- petesmart
- Valued Contributor
- Posts: 395
- Joined: Thu May 06, 2010 11:42 am
- Location: Sydney, Australia
- Has thanked: 187 times
- Been thanked: 140 times
- Contact:
Re: EEPROM Question
Hi,
I believe its a pic issue... Benj from MM put me onto it some time ago, and i did follow up on the Microchip website, which confirmed it.
It does not impact all PIC variants, just a few I believe...as a rule now I dont use location zero, just in case.
all the best
Pete
I believe its a pic issue... Benj from MM put me onto it some time ago, and i did follow up on the Microchip website, which confirmed it.
It does not impact all PIC variants, just a few I believe...as a rule now I dont use location zero, just in case.
all the best
Pete
sorry about that Chief!
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
- petesmart
- Valued Contributor
- Posts: 395
- Joined: Thu May 06, 2010 11:42 am
- Location: Sydney, Australia
- Has thanked: 187 times
- Been thanked: 140 times
- Contact:
Re: EEPROM Question
No problem, glad i could help.
this link maybe useful... follow the thread down to the middle of the posts.... BenJ provides some explaination
http://www.matrixmultimedia.com/mmforum ... n+0#p30258
cheers
Pete
this link maybe useful... follow the thread down to the middle of the posts.... BenJ provides some explaination
http://www.matrixmultimedia.com/mmforum ... n+0#p30258
cheers
Pete
sorry about that Chief!
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: EEPROM Question
Hi,
I wish I would have noticed this in the early Jan '12. We had a tough time with 100 s of 16f876 ICs...Work fine couple times..then don't work..re-write works few times..then same problem...
Few ICs don't work at all..
Thanks goes to you and Ben the Boss
Enamul
I wish I would have noticed this in the early Jan '12. We had a tough time with 100 s of 16f876 ICs...Work fine couple times..then don't work..re-write works few times..then same problem...
Few ICs don't work at all..
Thanks goes to you and Ben the Boss
Enamul
-
- Posts: 128
- Joined: Wed Jul 04, 2012 11:21 pm
- Location: Greece
- Has thanked: 51 times
- Been thanked: 19 times
- Contact:
Re: EEPROM Question
Hi, another issue that i have is about the stepper motor speed in flowcode.
How is it possible to program to have variable speeds during the motor's operation ?
How is it possible to program to have variable speeds during the motor's operation ?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: EEPROM Question
Hi George,
You vary the stepper motor speed by varying the time period between calling the step functions.
Using a delay you can simply edit the length of the delay.
Using a timer interrupt you can vary the timer period register.
You vary the stepper motor speed by varying the time period between calling the step functions.
Using a delay you can simply edit the length of the delay.
Using a timer interrupt you can vary the timer period register.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 128
- Joined: Wed Jul 04, 2012 11:21 pm
- Location: Greece
- Has thanked: 51 times
- Been thanked: 19 times
- Contact:
Re: EEPROM Question
Thanks very much for your reply!
To be honest i didn't get the way that i have to develop the flowchart to achieve that you just explained. Is there any example of this kind of program in flowcode?
Basically, i am trying to control a stepper motor driver (using pulse and direction signals). I can control the motor properly but i don't know how to adjust the speed of the pulses in order to have the motor running faster.
To be honest i didn't get the way that i have to develop the flowchart to achieve that you just explained. Is there any example of this kind of program in flowcode?
Basically, i am trying to control a stepper motor driver (using pulse and direction signals). I can control the motor properly but i don't know how to adjust the speed of the pulses in order to have the motor running faster.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: EEPROM Question
Hello,
Here is quick demo using delays.
Here is quick demo using delays.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 128
- Joined: Wed Jul 04, 2012 11:21 pm
- Location: Greece
- Has thanked: 51 times
- Been thanked: 19 times
- Contact:
Re: EEPROM Question
Hi Ben and thanks again!
I did something similar to your design.. the only "problem" is that the pulses are not very fast as i want to be and therefore the speed of the motor is still low..
In your example above, what is the frequency of the pulses if we suppose that the ADC is 0 ?
I did something similar to your design.. the only "problem" is that the pulses are not very fast as i want to be and therefore the speed of the motor is still low..
In your example above, what is the frequency of the pulses if we suppose that the ADC is 0 ?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: EEPROM Question
Hello,
In my example I added a delay of 50 to the ADC sample so the maximum speed would be 1/50ms or 20hz.
You could change this delay to say 1 to give you a max speed of 1000hz or even change the delay to us instead of ms which would give you much higher frequency ranges.
In my example I added a delay of 50 to the ADC sample so the maximum speed would be 1/50ms or 20hz.
You could change this delay to say 1 to give you a max speed of 1000hz or even change the delay to us instead of ms which would give you much higher frequency ranges.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 128
- Joined: Wed Jul 04, 2012 11:21 pm
- Location: Greece
- Has thanked: 51 times
- Been thanked: 19 times
- Contact:
Re: EEPROM Question
Hi again!! I managed to run and control the stepper motor properly after i tried several examples of coding..
Another think that i want to ask, is it possible to interface the DS1307 to PIC 16F877A using Flowcode? Do i have to use any component from Comms Menu in flowcode?
I am trying to make a digital clock ( actually i did it ) but i want to restore the data (hour,minutes,day) after the power goes off.
Regards
George
Another think that i want to ask, is it possible to interface the DS1307 to PIC 16F877A using Flowcode? Do i have to use any component from Comms Menu in flowcode?
I am trying to make a digital clock ( actually i did it ) but i want to restore the data (hour,minutes,day) after the power goes off.
Regards
George
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: EEPROM Question
Hello George,
The DS1307 device needs a I2C interface connection so you should be able to use the I2C component in Flowcode to communicate with the device.
Here is an article on the device.
http://www.matrixmultimedia.com/mmforum ... 307#p35668
The DS1307 device needs a I2C interface connection so you should be able to use the I2C component in Flowcode to communicate with the device.
Here is an article on the device.
http://www.matrixmultimedia.com/mmforum ... 307#p35668
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: EEPROM Question
Hi,
Here is a clock program using ECIO-40 but you can change that to any PIC with enough memory. To have clock running in the absence of power, you need to connect a 3.3V battery in Vbat pin of DS1307 IC. In the example program, you need to put time and date in the FIRST_TIME macro which keep record in EEPROM and next time when powers up..you don't need to think about time it will keep maintain real time.
Edit: For ECIO-40P
RB0/SDA
RB1/SCK
Hope this will help
Here is a clock program using ECIO-40 but you can change that to any PIC with enough memory. To have clock running in the absence of power, you need to connect a 3.3V battery in Vbat pin of DS1307 IC. In the example program, you need to put time and date in the FIRST_TIME macro which keep record in EEPROM and next time when powers up..you don't need to think about time it will keep maintain real time.
Edit: For ECIO-40P
RB0/SDA
RB1/SCK
Hope this will help
- Attachments
-
- ECIO_CLOCK_v1.fcf
- (42.91 KiB) Downloaded 289 times
-
- Posts: 128
- Joined: Wed Jul 04, 2012 11:21 pm
- Location: Greece
- Has thanked: 51 times
- Been thanked: 19 times
- Contact:
Re: EEPROM Question
Hi all!
I am facing an issue regarding a Timer program that i am currently working on.
I am using an interrupt (TMR0) in order to count seconds and so on..
The problem with my timer is that it is not quite accurate as it should be. The timer runs faster that the internet clock.
Is there anything that i have to look at in order to solve this problem?
Attachment = (F low C ode V ersion 5) Thanks in advance
George
I am facing an issue regarding a Timer program that i am currently working on.
I am using an interrupt (TMR0) in order to count seconds and so on..
The problem with my timer is that it is not quite accurate as it should be. The timer runs faster that the internet clock.
Is there anything that i have to look at in order to solve this problem?
Attachment = (F low C ode V ersion 5) Thanks in advance
George
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: EEPROM Question
Hi george
First off can you follow the link in my sig to enable access to the v5 forums as it make it easier to find questions if they are in the correct forums
If you do a forum search for timer theres a spread sheet somewhere that martin posted, which will help you get the correct times, also add an led and make a 1 second flasher as once thats right you know your clock settings are on the correct track
Regards
Dazz
First off can you follow the link in my sig to enable access to the v5 forums as it make it easier to find questions if they are in the correct forums
If you do a forum search for timer theres a spread sheet somewhere that martin posted, which will help you get the correct times, also add an led and make a 1 second flasher as once thats right you know your clock settings are on the correct track
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php