Eblocks2 BL0106 Click Board connection with GPS Click

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
OZ2ZTMonie
Posts: 10
Joined: Sun Oct 13, 2019 8:38 am
Been thanked: 1 time
Contact:

Eblocks2 BL0106 Click Board connection with GPS Click

Post by OZ2ZTMonie »

Hi everyone
Eblocks2 BL0106 Click Board in connection with GPS Click (3.3V)
https://www.mikroe.com/gps-click
User:dsPIC BL0032
How to set Eblocks2 BL0106 Click Board to 3.3v out for the device GPS click
How should the Codes in FlowCode be written?
Like a code example!
Is it something you want to help with?

Mikroe GPS click Code

Code: Select all

Code snippet

 1 void parse_gps( int *lat, int *lon )
 2 {
 3     char *string = strstr(txt,"$GPGLL");
 4     if( string != 0 ) {
 5         if( string[7] != ',' ) {
 6             *lat = ( string[7] - 48 )*10 + ( string[8] - 48 );
 7*lon = ( string[19] - 48 )*100 + ( string[20] - 48 )*10 + ( string[21] - 48 );
 8             
 9             if( string[17] == 'S' )
10                 *lat = 0 - latitude;
11             if(string[31] == 'W')
12                 *lon = 0 - longitude;
13         }
14     }
15 }
Like a simple FlowCode example

User avatar
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: Eblocks2 BL0106 Click Board connection with GPS Click

Post by Benj »

Hello,

The BL0032 board will automatically run the IO at 3V3.

As for interfacing the module you can either use the GPS component which should work well or you can instead use the UART component if you want to parse and decode the GPS NMEA message data yourself.

Example available here.
https://www.matrixtsl.com/wiki/index.ph ... (Wireless)

OZ2ZTMonie
Posts: 10
Joined: Sun Oct 13, 2019 8:38 am
Been thanked: 1 time
Contact:

Re: Eblocks2 BL0106 Click Board connection with GPS Click

Post by OZ2ZTMonie »

Hi Benj
Uses: Eblocks2 dsPIC BL0032

Can you see why, when the keyboard is pressed, the motor cannot run left or right?
With KeyPad 4 engine Start reverse and at KeyPad 6 engine run Forwards
Attached file:
BL0032_KeyPress.fcfx
(60.42 KiB) Downloaded 200 times
[img]
Switch_KeyPad.JPG
Switch_KeyPad.JPG (74.64 KiB) Viewed 4422 times
[/img]

OZ2ZTMonie
Posts: 10
Joined: Sun Oct 13, 2019 8:38 am
Been thanked: 1 time
Contact:

Re: Eblocks2 BL0106 Click Board connection with GPS Click

Post by OZ2ZTMonie »

Hi everyone

Is there anyone here who will help get the keyboard pressed, the Motor can't run left or right?

User avatar
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: Eblocks2 BL0106 Click Board connection with GPS Click

Post by Benj »

Hello,

Are you having the problem with the simulation or the actual hardware?

I have removed your output icons from the switch statement and now when I push and hold the keys 4 or 6 in simulation the motor spins.

OZ2ZTMonie
Posts: 10
Joined: Sun Oct 13, 2019 8:38 am
Been thanked: 1 time
Contact:

Re: Eblocks2 BL0106 Click Board connection with GPS Click

Post by OZ2ZTMonie »

Hi Benj
Uses: Eblocks2 dsPIC BL0032
Regarding: "output icons from the switch statement".
Have tried as the picture illustrates below and also completely removed them, but can only run Run Right.
PWM.JPG
PWM.JPG (12.71 KiB) Viewed 4390 times

OZ2ZTMonie
Posts: 10
Joined: Sun Oct 13, 2019 8:38 am
Been thanked: 1 time
Contact:

Re: Eblocks2 BL0106 Click Board connection with GPS Click

Post by OZ2ZTMonie »

Hi everyone
Uses: Eblocks2 dsPIC BL0032
Is there anyone here who will help with a Flowcode example web-like below?
https://github.com/CytronTechnologies/C ... WM_DIR.ino
https://github.com/CytronTechnologies/C ... r/examples

OZ2ZTMonie
Posts: 10
Joined: Sun Oct 13, 2019 8:38 am
Been thanked: 1 time
Contact:

Re: Eblocks2 BL0106 Click Board connection with GPS Click

Post by OZ2ZTMonie »

Hi everyone
Uses: Eblocks2 dsPIC BL0032
Is there anyone here who can tell me why I can in practice Run Left and Run Right but not simulate in Flowcode?
Is there something I'm doing wrong?
Or a better way to write the codes?

Attached the codes here!
BL0032_KeyPress-005.fcfx
(68.27 KiB) Downloaded 178 times
MotorKeyPad.JPG
MotorKeyPad.JPG (93.18 KiB) Viewed 4350 times
Uses the KetPad 4 keyboard to run the motor in the left direction and KetPad 5 to run the motor in the right direction.
MotorKeyPad2.JPG
MotorKeyPad2.JPG (36.97 KiB) Viewed 4350 times

OZ2ZTMonie
Posts: 10
Joined: Sun Oct 13, 2019 8:38 am
Been thanked: 1 time
Contact:

Re: Eblocks2 BL0106 Click Board connection with GPS Click

Post by OZ2ZTMonie »

Hi Benj

I can't get Windspeed to work with dsPIC BL0032
For example, user Port F/C F0 Pin 0
Do you have another suggestion?
Interuupt:
Interrupt Freq 50Hz.JPG
Interrupt Freq 50Hz.JPG (13.38 KiB) Viewed 4289 times
Interuupt:
Interrupt Aneometer.JPG
Interrupt Aneometer.JPG (13.6 KiB) Viewed 4289 times
See file below!
Attachment:
BL0032_KeyPress-012.fcfx
(66.94 KiB) Downloaded 203 times
Hope very much you will help with a solution ;-)
Compiler_Messages:

Code: Select all

Target folder: C:\Users\sun\Desktop
Source name:   C:\Users\sun\Desktop\BL0032_KeyPress-012.fcfx
Title:         
Description:   
Device:        PIC16.33E.BL0032
Generated by:  Flowcode v8.2.1.14
Date:          Monday, October 21, 2019 11:05:34
Users:         1
Registered to: monie jacobsen
License key: X6U4U7
https://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode\Common\Compilers\pic16\batchfiles\pic16_C30_comp.bat  "BL0032_KeyPress-012" "C:\Users\sun\Desktop\" "33EP256MU806"

C:\Users\sun\Desktop>xc16-gcc -c -mcpu="33EP256MU806" -omf=coff -funsigned-char -fno-short-double -Os -I"C:\PROGRA~2\Flowcode\Common\COMPIL~1\pic16\BATCHF~1\..\support\h" -I"C:\PROGRA~2\Flowcode\Common\COMPIL~1\pic16\BATCHF~1\" -std=gnu99 "BL0032_KeyPress-012".c -o "BL0032_KeyPress-012".o 
Options have been disabled due to restricted license
Visit http://www.microchip.com/ to purchase a new key.
BL0032_KeyPress-012.c: In function '_T1Interrupt':
coff-cc1.exe: warning: _T1Interrupt PSV model not specified for '_T1Interrupt';
assuming 'auto_psv' this may affect latency
BL0032_KeyPress-012.c: In function '_T2Interrupt':
coff-cc1.exe: warning: _T2Interrupt PSV model not specified for '_T2Interrupt';
assuming 'auto_psv' this may affect latency
BL0032_KeyPress-012.c: In function '_INT3Interrupt':
coff-cc1.exe: warning: _INT3Interrupt PSV model not specified for '_INT3Interrupt';
assuming 'auto_psv' this may affect latency
BL0032_KeyPress-012.c: In function '_INT4Interrupt':
coff-cc1.exe: warning: _INT4Interrupt PSV model not specified for '_INT4Interrupt';
assuming 'auto_psv' this may affect latency
BL0032_KeyPress-012.c: At top level:
BL0032_KeyPress-012.c:9160:2: warning: '_FGS' definition has been deprecated: consider migrating to #pragma config
BL0032_KeyPress-012.c:9160:2: warning: '_FOSCSEL' definition has been deprecated: consider migrating to #pragma config
BL0032_KeyPress-012.c:9160:2: warning: '_FOSC' definition has been deprecated: consider migrating to #pragma config
BL0032_KeyPress-012.c:9160:2: warning: '_FWDT' definition has been deprecated: consider migrating to #pragma config
BL0032_KeyPress-012.c:9160:2: warning: '_FPOR' definition has been deprecated: consider migrating to #pragma config
BL0032_KeyPress-012.c:9160:2: warning: '_FICD' definition has been deprecated: consider migrating to #pragma config
BL0032_KeyPress-012.c:9160:2: warning: '_FAS' definition has been deprecated: consider migrating to #pragma config
BL0032_KeyPress-012.c:9160:2: warning: '_FUID0' definition has been deprecated: consider migrating to #pragma config
.


Compilation successful!

Launching the linker/assembler...
C:\Program Files (x86)\Flowcode\Common\Compilers\pic16\batchfiles\pic16_C30_link.bat  "C:\Users\sun\Desktop\BL0032_KeyPress-012" 33EP256MU806 33E


xc16-ld 1.26 (A)

Program Memory  [Origin = 0x200, Length = 0x2aa00]

section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.text                        0x200               0x4ce           0x735  (1845)
.const                       0x6ce                0xc4           0x126  (294)
.text                        0x792              0x2698          0x39e4  (14820)
.dinit                      0x2e2a                 0xe            0x15  (21)

                 Total program memory used (bytes):         0x4254  (16980) 6%


Ivt Memory  [Origin = 0x4, Length = 0x1fc]

section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.ivt._T1Interrupt             0x1a                 0x2             0x3  (3)
.ivt._T2Interrupt             0x22                 0x2             0x3  (3)
.ivt._INT3Interrupt           0x7e                 0x2             0x3  (3)
.ivt._INT4Interrupt           0x80                 0x2             0x3  (3)


Auxflash Memory  [Origin = 0x7fc000, Length = 0x3ffa]

section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------

                     Total auxflash memory used (bytes):              0  (0) <1%


Data Memory  [Origin = 0x1000, Length = 0x7000]

section                    address      alignment gaps    total length  (dec)
-------                    -------      --------------    -------------------
.nbss                       0x1000                   0            0x44  (68)
.bss                        0x1044                   0            0x14  (20)

                 Total data memory used (bytes):           0x58  (88) <1%


Dynamic Memory Usage

region                     address                      maximum length  (dec)
------                     -------                      ---------------------
heap                             0                                   0  (0)
stack                       0x1058                              0x6fa8  (28584)

                 Maximum dynamic memory (bytes):         0x6fa8  (28584)

Generating HEX file

C:\Users\sun\Desktop>xc16-bin2hex -omf=coff "C:\Users\sun\Desktop\BL0032_KeyPress-012".cof 
. .

Generating Assembler file

C:\Users\sun\Desktop>xc16-objdump -omf=coff -S "C:\Users\sun\Desktop\BL0032_KeyPress-012".cof  1>"C:\Users\sun\Desktop\BL0032_KeyPress-012".asm 

HEX file creation successful!

Launching the programmer...
C:\Program Files (x86)\Flowcode v8\tools\mLoader\mLoader.exe  -eb091 "BL0032_KeyPress-012.hex" -config
Loading file...
File loaded from...
=> BL0032_KeyPress-012.hex
File sending...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

File sent!


FINISHED

OZ2ZTMonie
Posts: 10
Joined: Sun Oct 13, 2019 8:38 am
Been thanked: 1 time
Contact:

Re: Eblocks2 BL0106 Click Board connection with GPS Click

Post by OZ2ZTMonie »

Hi everyone
Does anyone here see why I can't see Satallites which is attached below?
Do you have a suggestion in the codes that the Satellite's number can be seen in the display?
File attached:
dsPIC_BL0032_GPS.fcfx
(18.7 KiB) Downloaded 197 times

User avatar
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: Eblocks2 BL0106 Click Board connection with GPS Click

Post by Benj »

Hello,

The satellite count record is currently set to no under the GPS component properties. Change this to yes and you should be able to get the sat count.
GPS.jpg
GPS.jpg (56.78 KiB) Viewed 4200 times

OZ2ZTMonie
Posts: 10
Joined: Sun Oct 13, 2019 8:38 am
Been thanked: 1 time
Contact:

Re: Eblocks2 BL0106 Click Board connection with GPS Click

Post by OZ2ZTMonie »

Hi Benj
Thank you very much.
That was the solution

Have a nice day at work;-)

Post Reply