We can help you step by step that's what we are here for.K9ACT wrote:Here is an example of a brick wall for me.
The program in this thread uses an ADC. A component icon is pulled down but I have no idea how it became and ADC. I can't find a list of components anywhere.
This is the level I am at and need some help.
Thanks,
Have you seen this :
http://www.youtube.com/watch?v=Xh68YXcT ... T38LfzIy0Q
?
Here is my mini tutorial:
Part 1
First open up a new Flowchart by selecting New Project if just loaded Flowcode or
From File Menu, select New, then New Project.
You will need to select the target device your using.
Some common target device like 16F88,16F877A have the configuration settings already built in.
Other less common target devices do not.
Its vital that configuration atr always checked an d set correctly so they match your hardware.
For example you may not have any external crystal so your using the microcontrollers internal oscillator therefore the internal oscillator must be selected within the configuration menu.
Not all microcontrollers have an internal oscillator, the 16F877a for example.
For more information on Configuration settings you can follow the link on my signature.
The ADC (Analogue to Digital Conversion) component in Flowcode V6 (I assume that's what your using?) is an Input component since it relies on an input voltage.
So you will need to click on Inputs menu at the top of Flowcode then select which ADC component you require. All the ADC components act the same e.g, the difference is in the simulation looks only.
For example in the Inputs menu left click on: 'Potentiometer Colour cap' icon then select Add to dashboad panel (this panel is the 2D panel) Now you will need to add a variable so when the analogue input voltage is read it will be assigned to either an 8 bit variable: range is from 0 to 255
or be assigned to a 16 Bit variable (but since the ADC components most commonly is 10bits the range will be from 0 to 1023)
To assign ADC component to either 8 bit or 10bit variable:
First add a variable e.g 8bit variable called ReadADC. (note with naming of variables no spaces are allowed, but you can use an underscore_to separate words if more than one word is required).
In project explorer (Found within View Menu ) Select the triangle next to Variables as shown: Type in the variable name in the Name of new variable i/p box.
Then you will need to select the type. (since the default is byte you do no need to select anything).
Out of good practice just place a 0 in Initial value box, This is not always required but if not sure then add a 0 anyway.
Now you will need to on your flowchart:
1) Drag a continuous loop between the BEGIN and the END
2) Drag a component icon from the side of flowchart symbols on to the continuous loop
3) Double Click on the component macro, select the + to expand pot_color_cap1
4) Select GetByte
5) Click on the arrow on Right of Return Value box
6) With Globals selected at the top of new opened window, Double click ReadADC variable, then select OK. If the properties window is not open, then right click on the pot that's on the dashboard panel and select Properties.
Click on the properties option (spanner icon), now select the channel that will be using for analogue input. EG is port A usually have analogue inputs so if you suing a 16F877a for example, you can use pins 2 to 5 (AN0 to AN3) or pins 7 to 10 (AN4 to AN7). Hint either look at the chip digram ( View, Chip) or look at the data sheet by going on this site:
http://www.microchip.com/
Jut concentrate on the Connection at this stage. Well will assume your Pot wiper is connected to pin 3 of 16F877a, in that case make sure Channel shows An 3.
If you can let me know what target device (microcontroller) your using,and what the clock source and frequency is e.g internal osc 8MHz etc
we can help you further.
Martin