- Netduino Forums
- → firestar's Content
firestar's Content
There have been 15 items by firestar (Search limited from 27-September 23)
#41464 Test I2C Communication
Posted by firestar on 13 December 2012 - 09:03 AM in General Discussion
#41447 Test I2C Communication
Posted by firestar on 12 December 2012 - 09:34 PM in General Discussion
Martin,
Welcome to the community.
Do you have any pull-up resistors connected to the I2C lines?
Regards,
Mark
Hi Mark,
Yes, I have 4k7 going to +5V. Everything is working fine at this point, I can write/read from any of the registers. My problem is im training to simulate fail criteria for instance if the EEprom wouldnt work, or wasnt installed at all. When I write to a wrong address, I2CDevice.Execute will still return a byte count to me. There's no acknowledge signal that I can find to check?
Right now to test the eeprom, I write a dummy value (random) to an address, and read it couple ms later and compare them. But I just wanted to check to see if this is the way to go or that there are diagnostics somewhere that I have missed.
BR,
Martin
#41458 Test I2C Communication
Posted by firestar on 13 December 2012 - 07:06 AM in General Discussion
#41469 Test I2C Communication
Posted by firestar on 13 December 2012 - 12:14 PM in General Discussion
I based on the following text:
This is done by sending the word address to the
24XX64 as part of a write operation (R/W bit set to 0).
After the word address is sent, the master generates a
START condition following the acknowledge. This terminates
the write operation, but not before the internal
address pointer is set. Then the master issues the
control byte again but with the R/W bit set to a one.
The problem im having is im not quite sure how .NET under the hood uses this R/W bit, as its part of the Address and from the managed side i can only influence the first 7 bits I believe. So I believe the R/W bit is part of the transaction and set internally by .NET, I have little I2C experience with other devices so im not sure if all devices use this 8th bit for R/W.
I am doing paged writes in my code as the datasheet warned me for that, but for sequential reads im doing full number of bytes assuming the eeprom will increment the address counter, I have not tested this yet.
BR,
Martin
#41432 Test I2C Communication
Posted by firestar on 12 December 2012 - 02:15 PM in General Discussion
#41530 Test I2C Communication
Posted by firestar on 14 December 2012 - 06:55 AM in General Discussion
#42654 Smart Meter PCB
Posted by firestar on 03 January 2013 - 06:36 PM in Project Showcase
Hi All,
I made my first design for a PCB using Fritzing. It will be used to read out the P1 port of my meter. I have this currently built up on my breadboard and seems to work nicely.
It has an EEProm for storage of settings (NTP Server, IP settings, Serial settingsetc..)
FET for signal inversion
Two LEDs for Web activity and P1 Activity
A switch to broadcast UDP messages to my AddressServer (based on BOOTP) to externally set IP parameters.
As I'm not an electronic designer, I'd like to get some feedback on the design. I tried to segregate the +5VDC as much to the bottom plane and the grounds to the top plane.
I'll make a shield out of it, but I have reduced the print to what I need in space (and drop price), that's why top left pins will not be used.
Thanks in advance.
#42918 Smart Meter PCB
Posted by firestar on 07 January 2013 - 05:48 PM in Project Showcase
Hi Paul,
Thanks for your comments. The double PCB is standard in Fritzing (in what I started out with) so I went with that for now. However since Fritzing is giving me some small issues i'm thinking about switching to the free version of Eagle and use something like Seeedstudio for the PCBs (as it will give me a few PCBs for the same price, so if I mess up one with soldering).
I checked the IC datasheet to make sure but they dont put the requirements out there, it is a simple eeprom. However I'm thinking if I shouldnt add a 10 and 100 nF cap to the incoming power supply to the board just to make it nice
I'm still thinking if I should make a shield (clip on) or just a seperate PCB with a few wire jumpers. That will allow me to mount the RJ connector nicely in a case.
Thanks.
Martin
#42029 PID controller
Posted by firestar on 22 December 2012 - 10:47 AM in Netduino Plus 2 (and Netduino Plus 1)
#41626 Multithreading
Posted by firestar on 16 December 2012 - 03:35 PM in Netduino Plus 2 (and Netduino Plus 1)
thank you Nicky for that hint, and i wondered why my sd card is so slow.
with threads it took me 2.5!! seconds to read 128 bytes. without just 0.6 seconds (all same code, iam just calling all threads now from main loop)
when leaving all other threads but the sd card read in main loop, i got 1.5 secs
on an empty project its 0.4secs, so not much difference
Are you sure its just the threading? I'm running 4 - 5 threads at the same time, UDP listener, webserver, serial server, main thread and sometimes a background worker to store data, I notice no (big) performance disadvantages on a standard ND+.
You know you can set priorities on your thread? I assume you have something going on in your main thread (the starting one) that keeps the other from executing.
#42253 Dutch Smart meter and S0 meter logging
Posted by firestar on 27 December 2012 - 10:18 AM in Project Showcase
Very nice!
I'm doing something similar (in C# though). I'm using a FET as inverter for the RX signal. Hopefully I can test my setup in the coming days to see if it all works, I have completed most code so its a matter of debugging :-)
Now I just need to find a suitable home automation system to log the data too :-) Too bad there arent any big open source projects on .NET going on for this :-(
#41624 bootp client
Posted by firestar on 16 December 2012 - 02:34 PM in Netduino Plus 2 (and Netduino Plus 1)
#42406 [solved] SerialPort problems
Posted by firestar on 29 December 2012 - 07:46 PM in General Discussion
Hi, I'm trying to read my smart meter, which should send a message every 10 seconds as a TTL signal. The signal is inverted, so i'm using a FET to invert the signal again. However when im reading in the software, i read zeros all the time, i cant get a single character in my buffer, also the event is pretty much fired continuously, I'm using the following code:
void comPort_DataReceived(object sender, SerialDataReceivedEventArgs e) { if (e.EventType == SerialData.Chars) { int bytesToRead = comPort.BytesToRead; // if we received any bytes in the serial buffer if (bytesToRead > 0) { byte[] buffer = new byte[bytesToRead]; comPort.Read(buffer, 0, bytesToRead); comPort.Flush();
right now im just trying to read the non inverted signal to see if it works before I hook up the FET. Did I miss anything in the code? Best Regards, Martin
#42424 [solved] SerialPort problems
Posted by firestar on 30 December 2012 - 09:44 AM in General Discussion
Hi,
I just modified my code to read per byte. Makes it easier to find starting and ending characters in the telegram as well.
The reason for the inverter is that the spec of the meter mentions SPACE > 4V and MARK = 0V. Because they use an opto on their side.
I will test some later today and see if that fixes anything.
#42450 [solved] SerialPort problems
Posted by firestar on 30 December 2012 - 05:46 PM in General Discussion
- Netduino Forums
- → firestar's Content
- Privacy Policy