Page 2 of 3

Re: MOD Operation selected after Minut

Posted: Tue Jul 10, 2018 1:54 pm
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.

Re: MOD Operation selected after Minut

Posted: Tue Jul 10, 2018 2:43 pm
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 ??

Re: MOD Operation selected after Minut

Posted: Tue Jul 10, 2018 3:18 pm
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

Re: MOD Operation selected after Minut

Posted: Tue Jul 10, 2018 4:15 pm
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.

Re: MOD Operation selected after Minut

Posted: Wed Jul 11, 2018 2:28 pm
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 13695 times
Attached test Coder:
READ FREQUENCY_dsPIC Miac-003.fcfx
(21.34 KiB) Downloaded 283 times
Have tried with a lot of code changes but unsuccessfully!
Hope you will be helpful in solving the above problem.

Re: MOD Operation selected after Minut

Posted: Thu Jul 12, 2018 10:12 am
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!

Re: MOD Operation selected after Minut

Posted: Thu Jul 12, 2018 12:30 pm
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.

Re: MOD Operation selected after Minut

Posted: Thu Jul 12, 2018 12:40 pm
by Monie Jacobsen
Hi Steve
When az = FloatFiktGrader has the same value, exit the loop

Re: MOD Operation selected after Minut

Posted: Thu Jul 12, 2018 2:23 pm
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.

Re: MOD Operation selected after Minut

Posted: Thu Jul 12, 2018 2:54 pm
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 286 times
To learn, I am very open to suggestions

Re: MOD Operation selected after Minut

Posted: Thu Jul 12, 2018 4:50 pm
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.

Re: MOD Operation selected after Minut

Posted: Fri Jul 13, 2018 9:53 am
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 268 times

Re: MOD Operation selected after Minut

Posted: Mon Jul 16, 2018 10:41 am
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 13638 times

Re: MOD Operation selected after Minut

Posted: Mon Jul 16, 2018 3:22 pm
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

Re: MOD Operation selected after Minut

Posted: Tue Jul 17, 2018 8:47 am
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

Re: MOD Operation selected after Minut

Posted: Tue Jul 17, 2018 7:54 pm
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?

Re: MOD Operation selected after Minut

Posted: Wed Jul 18, 2018 8:14 am
by LeighM

Re: MOD Operation selected after Minut

Posted: Wed Jul 18, 2018 10:39 am
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.

Re: MOD Operation selected after Minut

Posted: Wed Jul 18, 2018 11:09 am
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

Re: MOD Operation selected after Minut

Posted: Wed Jul 18, 2018 11:32 am
by Monie Jacobsen
Hi LeighM
Thank you very much for the information.
I'm trying to buy the device.

Re: MOD Operation selected after Minut

Posted: Sat Jul 21, 2018 11:33 am
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 13576 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 204 times

Re: MOD Operation selected after Minut

Posted: Sat Jul 21, 2018 1:49 pm
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.

Re: MOD Operation selected after Minut

Posted: Sat Jul 21, 2018 2:31 pm
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.

Re: MOD Operation selected after Minut

Posted: Sat Jul 21, 2018 3:41 pm
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 13569 times
However, nothing appears in the display.
Hope you can look at the picture where it goes wrong??

Re: MOD Operation selected after Minut

Posted: Sat Jul 21, 2018 6:24 pm
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.