Page 1 of 2

Digital Temperature

Posted: Tue Nov 09, 2021 3:55 pm
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.

Re: Digital Temperature

Posted: Tue Nov 09, 2021 4:09 pm
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

Re: Digital Temperature

Posted: Wed Nov 10, 2021 4:00 am
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.

Re: Digital Temperature

Posted: Wed Nov 10, 2021 10:39 am
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.

Re: Digital Temperature

Posted: Wed Nov 10, 2021 2:05 pm
by MartinSpeed
I screenshot the image

Re: Digital Temperature

Posted: Wed Nov 10, 2021 2:19 pm
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.

Re: Digital Temperature

Posted: Wed Nov 10, 2021 2:25 pm
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.

Re: Digital Temperature

Posted: Wed Nov 10, 2021 4:52 pm
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.

Re: Digital Temperature

Posted: Wed Nov 10, 2021 5:08 pm
by MartinSpeed
Here are the images. The program will not get passed initialising the EBM004

Re: Digital Temperature

Posted: Wed Nov 10, 2021 5:23 pm
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.

Re: Digital Temperature

Posted: Wed Nov 10, 2021 5:28 pm
by MartinSpeed
Here is the FlowCode file.

Re: Digital Temperature

Posted: Wed Nov 10, 2021 6:08 pm
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.

Re: Digital Temperature

Posted: Thu Nov 11, 2021 3:21 pm
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.

Re: Digital Temperature

Posted: Thu Nov 11, 2021 3:58 pm
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.

Re: Digital Temperature

Posted: Sat Nov 13, 2021 9:31 pm
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.

Re: Digital Temperature

Posted: Sat Nov 13, 2021 9:56 pm
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.

Re: Digital Temperature

Posted: Sat Nov 13, 2021 10:17 pm
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

Re: Digital Temperature

Posted: Sat Nov 13, 2021 10:20 pm
by MartinSpeed
This is the hardware set up

Re: Digital Temperature

Posted: Sat Nov 13, 2021 10:45 pm
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.

Re: Digital Temperature

Posted: Sat Nov 13, 2021 10:53 pm
by MartinSpeed
Thanks. Basic question but where do i do this please.

Re: Digital Temperature

Posted: Sat Nov 13, 2021 11:32 pm
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 18200 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.

Re: Digital Temperature

Posted: Mon Nov 15, 2021 10:19 am
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

Re: Digital Temperature

Posted: Mon Nov 15, 2021 10:21 am
by MartinSpeed
Here is the image of the component set up.

Re: Digital Temperature

Posted: Mon Nov 15, 2021 10:22 am
by MartinSpeed
I guess the pin set up on the infrared properties is not right but so many different combinations to try.

Re: Digital Temperature

Posted: Mon Nov 15, 2021 11:00 am
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).