Hello scorpy77.
In what way was your hardware not working as expect?
Did LED's light up at all?
Are you using EB006 programmer?
If you want to compile to Hex, and paste that, I can check your configuration settings are being transfered OK.
I did notice a couple of things with your software.
1) With a target speed of 19660800 Hz, you should use HS and not XT. This can by changed by 'Chip', 'Configure' then 'Switch to expert screen'
2) You will only get a random number when you release switch. The variable is counting in 1's, but it is counting very quickly with switch pressed in, so by the time switch is released it would of added 100's to variable. You will need to change your flowcode so it is not counting all the time the switch is held down (unless you require random numbers of course).
If you get stuck and that is the issue, then I can help you further.
input and out put problem
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: input and out put problem
Try this for counting.
Note: When you are setting options in the expert config screen' set is in the picture.
Note: When you are setting options in the expert config screen' set is in the picture.
- Attachments
-
- input1.fcf
- (6 KiB) Downloaded 285 times
Martin
- 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: input and out put problem
Hello,
If you are having wierd switch input problems then are you leaving the input pins floating at any time.
One common mistake is to have the I/O pin connected to VCC for a logic 1 and to disconnect the pin for a logic 0. This will not work in practise and you should have a weak pull down resistor to avoid noise entering the pin when the switch is not pressed.
If you are having wierd switch input problems then are you leaving the input pins floating at any time.
One common mistake is to have the I/O pin connected to VCC for a logic 1 and to disconnect the pin for a logic 0. This will not work in practise and you should have a weak pull down resistor to avoid noise entering the pin when the switch is not pressed.
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
- 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: input and out put problem
Hello Scorpy,
I think the problem may relate to the operation of your loop. It may be worth adding a small delay say 10 - 20 ms into the loop. If you do not have this delay in your program then you could potentially detect thousands of button presses rather then a single button press. This way you may also be able to get rid of the blocking functions eg the wait until low macros.
I think the problem may relate to the operation of your loop. It may be worth adding a small delay say 10 - 20 ms into the loop. If you do not have this delay in your program then you could potentially detect thousands of button presses rather then a single button press. This way you may also be able to get rid of the blocking functions eg the wait until low macros.
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