- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone, I am using 27443. My task is to output DAC value with timer, read ADC value at the same time, compare them to get the max value and display the max value on the LCD. I attached my prj below.
After that, the user will be asked whether to save it to E2PROM. If the answer is yes then I will jump to the next function.
The problem is, the LCD displayed everything (ADC value, the question) at the same time while I want it to happen in sequence, which means when all the process of DAC output and ADC comparison to get the max value finish, the question whether to save would pop up.
The same problem happens when I want to surf the saved struct in the E2PROM.
To be clear, I want the LCD to display things in sequence. Do you guys have any ideas on how to do that? I have stucked there for days...
Thanks in advance!
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The while-loop in your main1() controls everything, so: what do you want to have displayed when NO button is pressed.
When returning from your Start_scan() or Read_from_E2Prom() and the corresponding button is released what shall happen to the display, cleared? Wait for any user action, then clear?? Keeping the display until the button is released??? Waiting for 5 seconds, then clear the LCD????
You have all (and some more) choices.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This might be of use -
PSOC 1 State Machines
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you guys,
I decided to use timer to do the task The State Machine documents danaa provided gave me a thought but unfortunately I can't find the example project and besides I'm not familiar with State Machine so I had to find another way
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fine that you have got it working!. Using a timer is a quite common solution for problems like yours.
Take it as a friendly advice: State-machines are to be found everywhere and are a very mighty instrument to control software (and hardware) flow. Read how to use them and start programming simple machines. Since you are using PSoC1 you are a bit limited with debugging capabilities if you do not have got an ICE-Cube. So when you can spend the money get hands on a Pioneer Kit and extend your knowledge in PSoC programming.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the files for the ap notes, if you wish them send an
email to danaaknight@gmail.com
I cannot seem to get them to upload.
Regards, Dana/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob and danaa,
I use PSoC 1 for simple application to begin with the microcontroller programming, I have the plan to work with higher level of microcontroller and the Pioneer Kit is on the list.
danaa: I send an email to you, please send me the file for the app notes.
Thank you very much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I sent the files this morning.
Regards, Dana.