Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: AS3935 lightning detector Post ReplyPost New Topic
Page of 5 Next >>
Author
Message << Prev Topic | Next Topic >>
TassyJim
Guru
Guru


Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2221
Posted: 25 June 2017 at 8:28am | IP Logged Quote TassyJim

I have been porting Arduino code for the AS3935 lightning detector and have run into a problem.

MMbasic expects the I2C address to be between 8 and 127 to be considered valid.

The AS3935 chip has 2 address lines to set the I2C address but they only give us zero to three as possible addresses.
My module came fixed with 3 as the address.

Arduino doesn't seem to worry about the 0 to 7 addresses and lets them through but MMbasic throws an error (as it should).

I think I can use the I2CPort CFUNCTION on the MX chip-sets as it appears to be more forgiving. I need to setup and do a real life test to be sure.

Unfortunately, the MMX can't use CFUNCTIONS and that was the platform I used for developing.

I can change to one of the MX chips but is it feasible to relax the address checking for 7 bit addresses?

I will also investigate using SPI instead but I like to leave that for the display.

Jim



__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm


Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2117
Posted: 25 June 2017 at 9:19am | IP Logged Quote Geoffg

TassyJim wrote:
is it feasible to relax the address checking for 7 bit addresses?

That is a good point. If real world devices use these addresses then why disallow them?

Geoff

Edited by Geoffg on 25 June 2017 at 9:31am


__________________
Geoff Graham - http://geoffg.net
Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 
BobD
Guru
Guru
Avatar

Joined: 07 December 2011
Location: Australia
Online Status: Offline
Posts: 920
Posted: 25 June 2017 at 9:22am | IP Logged Quote BobD

See the attachment about I2C addressing.
It looks like it is possible but using a reserved address.
2017-06-25_092139_I2C_Slave_Addressing.pdf
Back to Top View BobD's Profile Search for other posts by BobD
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 1765
Posted: 25 June 2017 at 9:35am | IP Logged Quote matherp

Jim

Completely untested - test for 0-7 removed

100/144 pin

2017-06-25_093449_Micromite.X.production.zip

Let me know and I'll do a proper release

Back to Top View matherp's Profile Search for other posts by matherp
 
TassyJim
Guru
Guru


Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2221
Posted: 25 June 2017 at 9:52am | IP Logged Quote TassyJim

Thanks Peter,
I will give it a try but it will not be until tomorrow now.

I think the chip manufacturer of the chip was too stingy to apply for an I2C address range they could use and didn't want to cause problems by using someone elses.

It certainly had me guessing for a while!

Jim


__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
bigmik
Guru
Guru
Avatar

Joined: 20 June 2011
Location: Australia
Online Status: Offline
Posts: 1949
Posted: 26 June 2017 at 12:32am | IP Logged Quote bigmik

Hi Jim,

The chip can also respond using SPI by pulling (I think it was from memory) Pin 9 low...

Regards,

Mick

__________________
Mick's uMite Stuff can be found HERE

Back to Top View bigmik's Profile Search for other posts by bigmik
 
TassyJim
Guru
Guru


Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2221
Posted: 26 June 2017 at 6:59am | IP Logged Quote TassyJim

Yes Mick,
SPI is the next challenge.

I have it working on I2C on the MMX with a modified version of MMBasic from Peter.

All I need now is an electrical storm to see if it really works.

I will post the code once I have SPI working.

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
CaptainBoing
Guru
Guru
Avatar

Joined: 07 September 2016
Location: United Kingdom
Online Status: Offline
Posts: 300
Posted: 26 June 2017 at 11:28am | IP Logged Quote CaptainBoing

TassyJim wrote:

All I need now is an electrical storm to see if it really works.



be careful what you wish for

I use this quite a bit - but thankfully we aren't battered so much as you guys
https://www.lightningmaps.org/?lang=en#m=sat;r=0;t=3;s=0;o=0;b=;n=0;y=53.9845;x=-6.1304;z=7;d=2;dl=2;dc=0;

you might be able to use it for your testing (you could even contribute once it is all working)

Edited by CaptainBoing on 26 June 2017 at 11:32am


__________________

all you need is duct tape and WD40 (if it moves and shouldn't, use duct tape; if it doesn't move and should, use WD40)
Back to Top View CaptainBoing's Profile Search for other posts by CaptainBoing
 
Phil23
Guru
Guru


Joined: 27 March 2016
Location: Australia
Online Status: Offline
Posts: 1094
Posted: 26 June 2017 at 10:03pm | IP Logged Quote Phil23

CaptainBoing wrote:
I use this quite a bit - but thankfully we aren't battered so much as you guys
https://www.lightningmaps.org/?lang=en#m=sat;r=0;t=3;s=0;o=0;b=;n=0;y=53.9845;x=-6.1304;z=7;d=2;dl=2;dc=0;

you might be able to use it for your testing (you could even contribute once it is all working)


I use it too.

But contributing is not that easy, you need to apply to purchase one of their units.
You go on a list & they then assess your location & adjust your position in the list.

As stocks of the kit become available, you will be offered on if you have a low ranking on their list.

I applied back in March I think, & was ranked dead bottom initially, around the 1700's mark.

Checked again some weeks later & my ranking had dropped a bit (Smaller Better), but checked again a few moments ago & I'm now 2176/2176.

So either dropped off the list completely, or NSW/Australia is not considered of interest to the developers.

Their production run of boards seems to be in the 50/100 mark every few months or more.

That got me interested in these other modules.

Cheers

Phil.
Back to Top View Phil23's Profile Search for other posts by Phil23
 
Justplayin
Senior Member
Senior Member
Avatar

Joined: 31 January 2014
Location: United States
Online Status: Offline
Posts: 248
Posted: 26 June 2017 at 11:12pm | IP Logged Quote Justplayin

bigmik wrote:
The chip can also respond using SPI by pulling (I think it was from memory) Pin 9 low...


I've been working on a SPI version with less than stellar results. It's difficult to test a lightening detector when there is no real lightening to detect. I invested in a lightening "emulator" shield and an Arduino Uno which helped produced some encouraging results with my MMBasic code. However; when a real lightening storm came through recently, all I detected was three "disturbers". A disturber is a detection which is considered to be man made noise. So... It's back to the drawing board.

--Curtis

__________________
I am not a Mad Scientist... It makes me happy inventing new ways to take over the world!!

CGCOLORMAX2, CGMMSTICK1, DUINOMITE-MINI, MICROMITE-150, MICROMITE-170, SKINNYMITE, Explore64
Back to Top View Justplayin's Profile Search for other posts by Justplayin
 
TassyJim
Guru
Guru


Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2221
Posted: 27 June 2017 at 12:10am | IP Logged Quote TassyJim

Justplayin wrote:

I've been working on a SPI version with less than stellar results.
--Curtis

Is your unit indoors or outdoor?

I can get the disturber response easily enough too.

I will start with an outdoor location and play with the noise floor levels.
At least getting a few disturber triggers lets you know that it is alive.

I still think that having a dog frantically trying to climb up my leg is a more reliable detector.

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
Justplayin
Senior Member
Senior Member
Avatar

Joined: 31 January 2014
Location: United States
Online Status: Offline
Posts: 248
Posted: 27 June 2017 at 12:54am | IP Logged Quote Justplayin

TassyJim wrote:
Justplayin wrote:

I've been working on a SPI version with less than stellar results.
--Curtis

Is your unit indoors or outdoor?

I can get the disturber response easily enough too.

I will start with an outdoor location and play with the noise floor levels.
At least getting a few disturber triggers lets you know that it is alive.


I configured it for "indoors". For my initial setup and testing I used a piezoelectric camp stove igniter to trigger disturbers on-demand. When I test with the lightening emulator, I get varying distance and power readings as expected.

I'll be playing with the indoor outdoor setting and sensitivity setting. Also, the board manufacturer provided a calibration value for the internal tuning capacitors. I have been using that value for the TRCO recalibration. I think I'll try to have the software determine the value on startup like the Arduino code does.

TassyJim wrote:
I still think that having a dog frantically trying to climb up my leg is a more reliable detector.


Yep... The dog is a very reliable lightening detector.

If Dog = Under.Bed Then Print "Lightening detected!!"



--Curtis


__________________
I am not a Mad Scientist... It makes me happy inventing new ways to take over the world!!

CGCOLORMAX2, CGMMSTICK1, DUINOMITE-MINI, MICROMITE-150, MICROMITE-170, SKINNYMITE, Explore64
Back to Top View Justplayin's Profile Search for other posts by Justplayin
 


Page of 5 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.0781 seconds.
Privacy Policy     Process times : 0.02, 0, 0, 0.06