MOD Operation selected after Minut

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi medelec35
Thank you for the overview of the port for I1-I5
Again, I would like to thank you very much for the great help.

I print to a document so it's remembered another time.
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi medelec35
I can only get I1 and I2 to work in Practice!
The Flowcode Code you use to be able to simulate, I can get such a version to even simulate I1-I8 ??
Best Regard
Monie

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: MOD Operation selected after Minut

Post by medelec35 »

Hi Monie,
Monie Jacobsen wrote:I can only get I1 and I2 to work in Practice!
Looking at the datasheet on page 18:
Only I1 an I2 available.png
(63.04 KiB) Downloaded 4253 times
So for any logic input you can only use I1 & I2 that'a why you get the results you did.
Perhaps Matrix can confirm that you can't use I3 to I8 for logic inputs, only analog?
Monie Jacobsen wrote:The Flowcode Code you use to be able to simulate, I can get such a version to even simulate I1-I8 ??
I'm assuming you mean you can't get your own flowchart to simulate?
Just go to Simulation menu (Cog icon) and add Simulation External input:
Simulation External Input.png
(53.3 KiB) Downloaded 4253 times
Martin

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi medelec35
Thank you very much for your help.
I want to work with the project and thus learn more about Flowcode.
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hello Everbardy
With pulses on I2, and selected to INT2 / REMAP-
and port number RB1 and read the frequency fine now.

But know as the picture below shows, "executar um loop" does not work!
By AZ = 182 and FloatFiktGrader = 182 then "executor um loop" must be premature and out of loop and finished.
And a new Tracking must first be possible when AZ and FloatFiktGrader are different again!!
Also when FloatFiktGrader is less than AZ
executar um loop.JPG
executar um loop.JPG (57.83 KiB) Viewed 13393 times
Attached test Coder:
READ FREQUENCY_dsPIC Miac-003.fcfx
(21.34 KiB) Downloaded 276 times
Have tried with a lot of code changes but unsuccessfully!
Hope you will be helpful in solving the above problem.
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hello Everbardy
Is there anyone who will be helpful with the above / previous posts?
So I can get Tracking on / off to work!
Best Regard
Monie

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: MOD Operation selected after Minut

Post by Steve »

I don't understand what you are wanting to do.

At the moment, your program has a loop which effectively says "execute the commands within this loop if az does not equal FloatFiktGrader". If they are equal, it will not execute the commands inside the loop. If they are not equal, it will get stuck within the loop and continually execute the commands forever because there variables will not change once inside the loop.

So, you definitely need to read one or both of the variables within the loop, otherwise there is no opportunity for the variables to change and the expression ("az = FloatFiktGrader")to become false - and therefore to exit the loop.

You also need to be clear of whether you want to loop "until" the statement is true or "while" the statement is true. And you also need to think about if you want to check the statement at the beginning or the end of the loop.

I hope this helps.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi Steve
When az = FloatFiktGrader has the same value, exit the loop
Best Regard
Monie

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: MOD Operation selected after Minut

Post by medelec35 »

Hi Monie,
Since

Code: Select all

Fiktgrader
variable is only going to be an integer as its based on a pin I/P, then why convert to a float?
Also If the hardware is not working as intended,
Why don't you pass variable values to the Miac display for diagnostic purposes?
That way you can see for yourself what the possible cause is.
Martin

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi medelec35
Rigtigt mange tak for din information;-)

Code: Select all

variable is only going to be an integer as its based on a pin I/P, then why convert to a float?
The file AZer format Float therefore convert Fiktgrader to a float.
To be able to unite them. (compare them)
And being able to calculate with these two file formats.
But I am very open to suggestions :D
Look here!
Attached last code:
READ FREQUENCY_dsPIC Miac-004.fcfx
(20.54 KiB) Downloaded 279 times
To learn, I am very open to suggestions
Best Regard
Monie

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: MOD Operation selected after Minut

Post by Steve »

Monie Jacobsen wrote:Hi Steve
When az = FloatFiktGrader has the same value, exit the loop
Ok, I understand.

First, here's an example logic of the loop:
1) just before the start of the loop, read az and Fiktgrader
2) the loop should be a "while" loop that has the condition "az <> Fiktgrader", and test this at the start of the loop.
3) perform what you need to in the loop
4) near the end of the loop, read az and/or Fiktgrader again - you only need to re-read the value that will have changed

Please note that comparing floating point values is not always easy in a microcontroller because, for example, 1.00000000000 does not equal 1.0000000001 although for the logic of your program you might expect these to be equivalent.

Comparing integers is a lot easier, and as one of the quantities is originally an integer then I would suggest you convert the other float value to an integer and then compare the two integers.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi Steve
Thank you very much for your help.
Have the correct codes according to your proposal...
Do you want to review the attached file and correct or make improvements suggestions?
Please see the file below:
Attached updated file:
READ FREQUENCY_dsPIC Miac-009.fcfx
(18.14 KiB) Downloaded 259 times
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi Everbardy
Want to use "GPS Module NEO-6M with Flowcode v8 and dsPIC Miac...
Is there anyone who will help with any codes that GPS can run with?
Web-Link: https://www.hackster.io/ruchir1674/how- ... ino-8f90ad
or http://www.instructables.com/id/How-to- ... o-Arduino/
How do I find Analog input from I1-I8 to get in touch with "GPS Module NEO-6M
Connection.JPG
Connection.JPG (14.35 KiB) Viewed 13336 times
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi Everbardy
Is there anyone who will be helpful with the above.
The trouble is to find the Port number for reading the GPS signal. I can not find. :x
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: MOD Operation selected after Minut

Post by LeighM »

Hi Monie,
Looks like the GPS module uses TTL UART, Tx and Rx
So the Flowcode component will require Tx on Port E.0 and Rx on Port E.1 for the default RS232 port on dsPIC MIAC

Please note that the external serial interface on the MIAC is at RS232 levels,
so cannot be directly connected the the module TTL pins, but will require an RS232 to TTL convertor.

Leigh

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi LeighM
Thank you very much for your reply.
It's very boring that GPS can not work with dsPIC Miac.
Is there any GPS that can work directly with dsPIC Miac?
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: MOD Operation selected after Minut

Post by LeighM »


Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi LeighM
Thank you very much for your proposal.
But I have purchased this MIAC - GPS expansion module MI8582, but it is not particularly sensitive!
It would be desirable with the possibility of an antenna connection.
Is it not possible to connect the GPS device with an external plug for connecting the antennas.
Something similar:
Ant:
https://www.ebay.com/itm/153068796850
Otherwise, it's a suggestion from me.
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: MOD Operation selected after Minut

Post by LeighM »

Hi Monie,

No, the MIAC GPS expansion module does not have a plug for connecting external antenna.

To use the GPS Module NEO-6M you just need a "RS232 to TTL Serial Converter"
Such as this one .. https://www.digikey.co.uk/product-detai ... 68-1193-ND

TTL side connected to the GPS module, RS232 side connected to MIAC

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi LeighM
Thank you very much for the information.
I'm trying to buy the device.
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hello Everbardy
User Flowcode v8
User MIAC dsPIC
https://www.instructables.com/id/How-to ... o-Arduino/
Try to get the GPS device to work on with MIAC dsPIC and connect to RS232.
But it does not succeed.
No signal to see with dsPC MIac
Below you can see how the device is connected!
RS232ToMiac.JPG
RS232ToMiac.JPG (52.9 KiB) Viewed 13274 times
Is there anyone who will be helpful with a Code example for dsPC Miac
See attached code example below!
GPStest-dsPIC Miac.fcfx
(23.82 KiB) Downloaded 199 times
Best Regard
Monie

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: MOD Operation selected after Minut

Post by kersing »

Your connections do not seem right.

Miac is RS232 level according so should be connected to the pins at the top marked RS-232. I would connect MIAC RX to T1OUT, MIAC TX to R1IN, GPS RX to R1OUT and GPS TX to T1IN. For the MIAC I am referring to the connections at the top right op the MIAC labelled Rx and Tx.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi kersing
Thank you very much for your guidance.
Have been round on Flowcode to find a connect example.
Now I will try your description ;-)
Returns and tells you if it works.
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: MOD Operation selected after Minut

Post by Monie Jacobsen »

Hi kersing
Testing your proposal.
Has connected MIAC (I6) RX to T1OUT and MIAC (I5) TX to R1IN.
And GPS RX to R1OUT and GPS TX to T1IN.
No dsPIC Miac display appears.
See attached bille below, and you can see how I've connected the devices successfully.
TestGps.jpg
TestGps.jpg (117.59 KiB) Viewed 13267 times
However, nothing appears in the display.
Hope you can look at the picture where it goes wrong??
Best Regard
Monie

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: MOD Operation selected after Minut

Post by kersing »

You need to connect to Miac RX and TX, the pins upper right, next to the power connector. And of course set the component to use that serial port.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Post Reply