Digital Temperature

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

Moderator: Benj

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Digital Temperature

Post by MartinSpeed »

Hi, I am having problems initialising a Digital Temperature module EBM004 using a EB090 board. I was wondering if the board requires its own power, e.g. I have a 9V battery to connect, where, and I can get power from the main UNO R3 combo board but where, or, the Uno board has its own power so can the EB090 board take the power from the UNO board.

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

Re: Digital Temperature

Post by Steve »

As this is an E-blocks board, I am assuming you are using the EB093 upstream board to host the Arduino. The EBM004 module will get its power from the EB090 board. Ground will be connected via the E-blocks port and so the only connection you should need to make is the "+V" of the EB093 needs to connect to the "+V" of the EB090.

I hope this helps. More details, as well as connection diagrams, can be found in this document:
https://www.matrixtsl.com/resources/fil ... asheet.pdf

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

Thanks for reply. I have attached an image and since then connected the power as you suggested. I cannot get it to initiate. The program compiles but wont get passed the initialising of EBM004. I am sorry but my background is not in connection diagrams that you provided.

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

Re: Digital Temperature

Post by Steve »

There's no image attached to your post. Please attach an image of your hardware wiring and also attach your Flowcode program and we'll try to work out what the problem is.

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

I screenshot the image
Attachments
Screenshot_20211110-130409_Gallery.jpg
Screenshot_20211110-130409_Gallery.jpg (35.54 KiB) Viewed 15261 times

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

Re: Digital Temperature

Post by Steve »

It looks like the EB090 has no power. See this from my earlier post:
Steve wrote:
Tue Nov 09, 2021 4:09 pm
...the only connection you should need to make is the "+V" of the EB093 needs to connect to the "+V" of the EB090.
If that doesn't fix it, please post your project file.

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: Digital Temperature

Post by medelec35 »

Just to add to Steve's post.
The D type connections do not supply power.
They supply signals and GND only.
If the only connections are via D connectors then it's what Steve has stated.
Martin

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

I did say that i had connected the power after I took the image and it still didn't work. I will set it up again and repost. I feel that we are getting somewhere so thanks. Will repost the new image soon. Thanks for your help.

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

Here are the images. The program will not get passed initialising the EBM004
Attachments
Screenshot_20211110-160509_Gallery.jpg
Screenshot_20211110-160509_Gallery.jpg (35.1 KiB) Viewed 15240 times
Screenshot_20211110-160516_Gallery.jpg
Screenshot_20211110-160516_Gallery.jpg (37.15 KiB) Viewed 15240 times

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

Re: Digital Temperature

Post by Steve »

The connection looks ok, but I need to check your program. Please attach your program and we'll have a look - drag the file onto your post when you reply, or use the "add files" button on the "attachments" tab. Sorry, but a screenshot of your program is not sufficient.

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

Here is the FlowCode file.
Attachments
Dig Temp Test 1.fcfx
(11.96 KiB) Downloaded 169 times

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

Re: Digital Temperature

Post by Steve »

There's a few things wrong, mainly to do with the connections you have specified for the sensor within your program. It has been a long time since I used these boards, so please bear with me. Also, I do not have access to these boards so hopefully the following is correct...

First off, your program has both the SDA and SDL lines of the connection to the sensor as PORTC.0. Obviously this won't work and you need to specify how the pins are actually connected on your hardware.

Looking at your hardware, the sensor is in "socket 2" of the EB090, which according to p5 of the pdf means it is connected to bits 3, 5, 6 and 7 of the D-type connector. This connector is connected to the E-blocks socket labelled "D8-13", which equates to PORTB of the AVR chip used by the Arduino board. Unfortunately, this port does not have all 8 bits available due to a limitation of the Arduino (the top 2 bits of the port are actually used for the onboard crystal). The upshot is you cannot connect the module like this.

Instead, you will need to connect the sensor to "socket 1" of the EB090. Then, S1-4 will connect to bits 2-5 of that port (page 5 of the pdf), which in turn equates to PORTB bits 2-5 of the AVR chip on the Arduino. Page 8 pf the pdf shows how this specifically relates to the temperature sensor. SCL is S4 and SDA is S3. S1 is INT (optional) and S2 is not used. Equating this to your program, SDA of your sensor needs to be set to PORTB.4 and SDL needs to be set to PORTB.5.

Hopefully making these changes (sensor into socket 1 and SDA/SCL to B4/B5) should allow the hardware to work.

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

I cannot believe that it now works based on your help. I hope you get how much this means to me so thank you very much. The fact that the digital temperature is now working does this go that other eblocks, eg the infared would work in the same way.

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

Re: Digital Temperature

Post by Steve »

That's great, Martin. Thanks for letting us know.

You can determine the required connections for the other sensors using the same principle. If you're using that limited "D8-13" connector on the Arduino E-blocks board then you will probably only be able to use sensors in "socket 1". The images for each sensor in the datasheet show what their connections are in terms of S1-S4. For your setup, S1 is actually PORTB.2, S2 is actually PORTB.3, etc.

So, for example, if you have the infrared board in "socket 1" then IN = S3 = PORTB.4 and OUT = S4 = PORTB.5.

HTH,
Steve.

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

The input ADC channel has 'An' values rather than port values, output enable pin has port values. I am using position S1 on the EB090 board. The example (downloaded from your help pages) infrared EBM020 program will not compile.

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: Digital Temperature

Post by medelec35 »

Hi Martin,
As you would have changed the target device to suit your hardware.
Can you post your flowchart and the .msg.txt file that's within your project folder.
Martin

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

Target folder: C:\Users\hermi\DOWNLO~1
Source name: C:\Users\hermi\Downloads\Infrared Test1.fcfx
Title:
Description:
Device: PIC.16F.16F1937
Generated by: Flowcode v7.3.0.5
Date: Saturday, November 13, 2021 21:14:20
Users: 1
Registered to:
Licence key: *****
NOT FOR COMMERCIAL USE
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe --chip=16F1937 "Infrared Test1.c" --MSGDISABLE=359,1273,1388
Microchip MPLAB XC8 C Compiler (Free Mode) V1.41
Build date: Jan 24 2017
Part Support Version: 1.41
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

. . . . . . . . . . . . . . . . . . . . . .

Infrared Test1.c: 945: (1257) local variable "_FCR_RETVAL" is used but never given a value (warning)
. . . . . . . . . . . . . . . . .


Memory Summary:
Program space used 7A2h ( 1954) of 2000h words ( 23.9%)
Data space used 5Fh ( 95) of 200h bytes ( 18.6%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Data stack space used 0h ( 0) of 1A0h bytes ( 0.0%)
Configuration bits used 2h ( 2) of 2h words (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)


You have compiled in FREE mode.
Using Omniscient Code Generation that is available in PRO mode,
you could have produced up to 60% smaller and 400% faster code.
See http://www.microchip.com/MPLABXCcompilers for more information.


Launching the linker/assembler...
C:\Program Files (x86)\Flowcode 7\tools\DoNothing\DoNothing.exe

Launching the programmer...
C:\Program Files (x86)\Flowcode 7\tools\mLoader\mLoader.exe -chip 16F1937 "C:\Users\hermi\DOWNLO~1\Infrared Test1.hex"
. . . . . . . . . . . . . . . . . .

Doesn't get passed this
Attachments
Infrared Test1.fcfx
(12.55 KiB) Downloaded 140 times

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

This is the hardware set up
Attachments
Screenshot_20211113-211858_Gallery.jpg
Screenshot_20211113-211858_Gallery.jpg (34.22 KiB) Viewed 15163 times

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: Digital Temperature

Post by medelec35 »

MartinSpeed wrote:
Sat Nov 13, 2021 10:17 pm
Target folder: C:\Users\hermi\DOWNLO~1
Source name: C:\Users\hermi\Downloads\Infrared Test1.fcfx
Title:
Description:
Device: PIC.16F.16F1937
Generated by: Flowcode v7.3.0.5
You have got the wrong target device slected.
Your hardware has not got the PIC16F1937.
When you load an example flowchart, you must change the target device and configurations settings (if applicable) to match your actual hardware.
Martin

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

Thanks. Basic question but where do i do this please.

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: Digital Temperature

Post by medelec35 »

Anything to do with hardware, you use the Build menu.
To change the target device its Build, Project options, Choose a Target tab.
You will need to select AVR, then Arduino in the Family dropdown selection, then select the correct target:
Arduino Target..png
Arduino Target..png (104.26 KiB) Viewed 15161 times
Within Build, Project options, General Options tab. you will need to select the correct programming port.
If you open the flowchart before connecting your hardware, you will need to select the Reload icon, which is situated next to save icon.
Note after changing the target device, you will more than likely need to change the pin connections of the components.
Martin

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

Hi, I now have at least the first output going to the UNO R3 display but the values do not change when i move my hand or paper over the sensor. I am on my computer, so I will post the images of the set-up in the next post from my phone. Thanks for your help. Here is the compiled message.

Target folder: C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1
Source name: C:\Users\martin.speed\OneDrive - Hugh Baird College\AA Unit 6 2nd Year\Infrared 2.fcfx
Title:
Description:
Device: AVR.ATMEGA.ATMEGA328P
Generated by: Flowcode v7.2.1.4
Date: Monday, November 15, 2021 09:18:44
Users: 1
Registered to: John.Carroll
Licence key: DXFT6H
NOT FOR COMMERCIAL USE
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode 7\compilers\avr\batchfiles\avra.bat atmega328p "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.elf" "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.c" "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.lst"
Launching compiler...

C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1>"C:\PROGRA~2\FLOWCO~1\COMPIL~1\avr\BATCHF~1\..\bin\avr-gcc.exe" -mmcu=atmega328p -Os -funsigned-char -o "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.elf" "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.c" -lm

C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1>"C:\PROGRA~2\FLOWCO~1\COMPIL~1\avr\BATCHF~1\..\bin\avr-objdump.exe" -S "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.elf" 1>"C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.lst"

C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1>"C:\PROGRA~2\FLOWCO~1\COMPIL~1\avr\BATCHF~1\..\bin\avr-size.exe" -B -d "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.elf"
text data bss dec hex filename
12080 30 36 12146 2f72 C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.elf

Compilation successful!
Completed compilation, return = 0

Launching the linker/assembler...
C:\Program Files (x86)\Flowcode 7\compilers\avr\batchfiles\avrb.bat "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.elf" "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.hex" "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.cof"

C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1>"C:\PROGRA~2\FLOWCO~1\COMPIL~1\avr\BATCHF~1\..\bin\avr-objcopy" -O ihex -R .eeprom "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.elf" "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.hex"

HEX file creation successful!

C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1>"C:\PROGRA~2\FLOWCO~1\COMPIL~1\avr\BATCHF~1\..\bin\avr-objcopy" -O coff-avr -R .eeprom "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.elf" "C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1\Infrared 2.cof"

COFF file creation successful!

Launching the programmer...
C:\Program Files (x86)\Flowcode 7\compilers\avr\batchfiles\avrc_arduinoA.bat m328p arduino com4 115200 "Infrared 2.hex"

C:\Users\MARTIN~1.SPE\ONEDRI~1\AA6786~1>"C:\PROGRA~2\FLOWCO~1\COMPIL~1\avr\BATCHF~1\..\bin\avrdude.exe" -p m328p -P com4 -b 115200 -c arduino -D -U flash:w:"Infrared 2.hex"

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e950f
avrdude.exe: reading input file "Infrared 2.hex"
avrdude.exe: input file Infrared 2.hex auto detected as Intel Hex
avrdude.exe: writing flash (12110 bytes):

Writing |
#####
#
#
#
#
#
#
#
#
#
##
#
#
##
#
#
#
#
#
#
#
#
##
#
#
#
#
#
#
##
#
#
#
#
#
#
#
#
#
#
## | 100% 2.15s

avrdude.exe: 12110 bytes of flash written
avrdude.exe: verifying flash memory against Infrared 2.hex:
avrdude.exe: load data flash data from input file Infrared 2.hex:
avrdude.exe: input file Infrared 2.hex auto detected as Intel Hex
avrdude.exe: input file Infrared 2.hex contains 12110 bytes
avrdude.exe: reading on-chip flash data:

Reading |
#######
#
##
##
#
##
#
#
##
##
#
##
#
##
#
##
#
##
#
##
#
#
##
##
#
##
#
##
#
# | 100% 1.56s

avrdude.exe: verifying ...
avrdude.exe: 12110 bytes of flash verified

avrdude.exe done. Thank you.


Programming successful!
.


FINISHED
Attachments
Infrared 2.fcfx
(13.41 KiB) Downloaded 128 times

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

Here is the image of the component set up.
Attachments
Screenshot_20211115-091959_Gallery.jpg
Screenshot_20211115-091959_Gallery.jpg (41.2 KiB) Viewed 15125 times

MartinSpeed
Posts: 28
Joined: Tue Nov 09, 2021 11:53 am
Been thanked: 1 time
Contact:

Re: Digital Temperature

Post by MartinSpeed »

I guess the pin set up on the infrared properties is not right but so many different combinations to try.

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

Re: Digital Temperature

Post by Steve »

According to the datasheet, the infrared sensor provides an analogue output signal which means the output signal from the sensor (S4) needs to be connected to a suitable analogue input. Unfortunately, your hardware configuration has the sensor connected to PORTB of the micro, which has no analogue input capability. The use this (or any other) analogue sensor, your board would need to be connected to PORTC of the micro, which is the E-blocks connector labelled A0-A5 (the "A" means "analogue").

To do this and still use the EB083 comboboard, you would need to disconnect the boards and use cables to connect between the Arduino E-block and the other boards. EB090 would need to connect with the port labelled "A0-A5" and the EB083 connected to both the other ports (or possibly just one if you only needed the LCD).

Post Reply