Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

I2C configuration help needed! :)


  • Please log in to reply
25 replies to this topic

#1 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 12 March 2012 - 08:35 PM

hi all,
i am using net fw 4.2.0.0
using ds1307 for RTC,
based on AT91SAM7x512 mcu datasheet i used my wire configuration as:
SCL->PA11
SDA->PA10

what will be I2CAddress ?
currently i am using 0x68 for it (not working), here is my code sample:
private const int I2CAddress = 0x68;
        private const int I2CTimeout = 1000;
        private const int I2CClockRateKhz = 100;
private I2CDevice clock = new I2CDevice(new I2CDevice.Configuration(I2CAddress, I2CClockRateKhz));




is it a must for i2c
SDA -> PA14 //analog pin 4
SCL -> PA15 //analog pin 5

?

#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 12 March 2012 - 09:40 PM

If you are using N/N+ the I2C pins are fixed to analogue pins 4 for SDA and 5 for SCL.

There are some pitfalls to watch out for when using I2C, please do have a look at this post:

http://forums.netdui...dpost__p__25381

#3 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 13 March 2012 - 12:35 PM

actually :) yes and no, we use N+ architecture but not itself.. we redesigned our pcb for our needs and we used N+ architecture.. we added vs1053b, RTC, 2 lines lcd, 2 extra buttons and some couple things.. (my company distributes legal music to chain stores, shopping malls etc..) while we were checking the documentation, we saw that FSA2257Mux is hard to find in our country market.. we dont need any muxer for muxing between analog and digital. so we removed it and directly connected to PA11 and PA10 but we couldnt find I2CAddress adress related to it.. thats why i am asking :))

#4 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 13 March 2012 - 02:41 PM

Oh, so you put together your own hardware implementing an N+, cool!

According to the Maxim DS1307 datasheet, the 7 bit device address is 0x68

http://datasheets.ma...n/ds/DS1307.pdf

I take it you did not to forget the pull-ups.

Btw, I've done some work involving the vs1053b - what are your impressions of it?

#5 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 13 March 2012 - 06:03 PM

Hmm so how can we set our pin configuration according to our settings? For the vs1053b, it works very well but i have some notes about it.. İf you play wma after mp3 , you will get silence.. Also if you play mp3 after wma you will also get silence.. But you can play mp3 files after and after.. Also still i cant get audio level (for vumeter purposes) .. But the vs1053b documentation taljs about a patch.. Still i am not able to do it.. :)) i also have many experiences about it.. Also n+ network speed is too slow.. Max dl rate is 40kb/s

#6 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 13 March 2012 - 08:18 PM

Hmm so how can we set our pin configuration according to our settings?

I don't quite get what you mean by this. What are PA11 and PA10, are those the native pin names of the AT91SAM7x512 corresponding to pins 4 and 5 in the Netduino implementation?

İf you play wma after mp3 , you will get silence..
Also if you play mp3 after wma you will also get silence.. But you can play mp3 files after and after..
Also still i cant get audio level (for vumeter purposes) .. But the vs1053b documentation taljs about a patch.. Still i am not able to do it..

So far I only use it to play mp3, wav and ogg but I think the patches address these issues and others. I know for sure that the patch is required for the VU-meters. Have you tried patching the chip?

Also n+ network speed is too slow..
Max dl rate is 40kb/s

I've got an N+ laying around but have yet not done any work involving the network features.

#7 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 14 March 2012 - 12:31 AM

SDA -> PA14 //analog pin 4 SCL -> PA15 //analog pin 5 These are the default pins of n+ pa14 is the pin in mcu's schematics But i want to use SCL->PA11 SDA->PA10 For I2C AT91SAM7x512 document and schematics says that i can use it The n+ sdk maps pa14 to pin4 and pa15 to pin5 Those pin4 and pin5 are enums and private I2CDevice clock = new I2CDevice(new I2CDevice.Configuration(I2CAddress, I2CClockRateKhz)); I2CDevice object default maps to them, what i want to kniw, is it possible to map them to my pin configuration

#8 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 14 March 2012 - 12:46 AM

For the vs1053b, the patch is about to patch chip for vumeter and some other fearures İn vs1053d it is already patched.. But i coludnt patch the vs1053b, if you know how to do it , please teach me :) For the network: İ also have ghi panda and domino devices and ethernet shield, it is slower than n+ but n+ eats many memory area for tcpip stack İ wrote http and ftp classes from stratch and still the speed is too bad for downloading mp3 or such things. İt says it is 10/100 but it is not :) Also i have android based arm9 and some other mcus And i have android tv box devices.. The interesting part is : The n+ has 55mhz, 30-40 km ram , 40-80kb/s download speed, no usb etc, with vs1053 my device will cost near 50 usd The android tvbox has: 1 ghz cpu, 512 mb ram, 4gb nand storage, ethernet, wireless, 4 usb, sdcard, hdmi output, analog and digital audio, composite video output Remote controller, full operating system, mali 400 gpu , mkv and h264 native decoding, full enclosure Guess what? Finished device is 50 usd... Unfortunately i found them 2 weeks ago, but i was working on my own n+ more then 2 months.... i want to make this device work, then i will return to android device....

#9 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 14 March 2012 - 12:49 AM

On android i used monodroid , this is c# for android Also i used basic4android and it is really fast.. i also used java, but for rapid development i suggest basic4android.. İt has visual basic syntax... And has almost everything.. Sorry for text mistakes, i am writing these with iphone keyboard :))

#10 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 14 March 2012 - 09:06 AM

About patching the vs1053b, I got some working C# code for this at home. I'll send it to you this evening (@work now).

The Android TV box, is it this one:

http://www.sureelect...ods.php?id=1582

May I ask where you found such box for 50$?

Sorry, I don't know about remapping I2C pins in the N+ tinyclr port.


About networking, I did some experiments with the ENC28J60 chip and came very close to 10Mbit/sek over raw ethernet:

http://forums.netdui...dpost__p__11546

#11 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 14 March 2012 - 09:08 AM

About patching the vs1053b, I got some working C# code for this at home. I'll send it to you this evening (@work now).

The Android TV box, is it this one:

http://www.sureelect...ods.php?id=1582

May I ask where you found such box for 50$?

Sorry, I don't know about remapping I2C pins in the N+ tinyclr port.

About networking, I did some experiments with the ENC28J60 chip and came very close to 10Mbit/sek over raw ethernet:

http://forums.netdui...dpost__p__11973
http://forums.netdui...dpost__p__11546

#12 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 14 March 2012 - 10:52 AM

check these links:
http://www.alibaba.c...Android_TV.html
http://www.alibaba.c...ndroid.html?s=p

also i can directly send you the features... i already bought 200 piece.. :))
they made custom housing, custom logo , custom boot logo , custom boot animations, menu items etc..
even the cartoon box is already customized..

here is the picture of it:
Posted Image



also here is our custom N+ device :
Posted Image
Posted Image
Posted Image

#13 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 14 March 2012 - 11:28 AM

Wow, very impressive little box! Seems to be somewhat similar to the one I linked to. Did you make these from scratch yourself or did you "only" customize them? I think I see the vs1053b and it's 12.288 Mhz crystal on the board and I guess the battery is for the RTC?

#14 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 14 March 2012 - 11:42 AM

there are hundreds of different android tvbox devices on alibaba.. also you can directly purchase from aliexpress.com

we made it from scratch , we read the atmel and netduino plus documentations and schematics..
also as you see, we replaced some components from original design....

yes the crstal and battery is for rtc.. as you know N+ does not have rtc backup battery..
our system uses scheduled playlists , so without internet we have to know what the time is..
thats why we used battery..

here are the photos of our development phase device while coding:
Posted Image
Posted Image

and this is the final device's schematic:
Posted Image

#15 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 14 March 2012 - 11:56 AM

by the way, i have 4-5 different android devices purchased before.. i opened all of them :)) what i see is, there is one android device board on the top and all manufacturers/assemblers made their expansion units (hdmi out, usb, vga, sdcard slot, wireless etc.. ) so the outer plastic box differs from one to another.. but all uses same kind of main android boards.. cortext, Amlogic8726 etc cpus.. actual mainboard supports 4 usb + 1 host usb but some manufacturers removes some usb ports, vga out , even rtc battery to reduce price of the device :)) also the wireless module is 7-8 usd and that is optional when buying.. they solder it inside the device.. all those devices can use usb mouse and keyboard.. the first 2 device i ordered did not have rtc battery.. the third one has it but the user interface was not good and it heats much.. the fourth one was perfect (the picture i send).. the user interface etc works incredible fast.. also the remote controller is more complex then the others.. all others have credit card size remote controlers and does not work properly.. anyway this device is amazing.. forexample i put a iso and img dvd file, just clicked it and it mounted image file automatically and started to play.. i tried h264 1080p dts videos.. normally my lg and samsung and also WDTV device can not play dts sounds.. but this device played it perfectly on analog output..

#16 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 14 March 2012 - 12:32 PM

the fourth one was perfect (the picture i send)..
...anyway this device is amazing..

Is that the one you bought 200 pc of or did I misunderstand?

Took a quick look at AliExpress and yes, there really are hundreds of these so I'm not surprised that they're all pretty much the same inside.

Seems you got a wonderful job, evaluating and constructing cool gadgets - congrats!

#17 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 14 March 2012 - 12:50 PM

yes thats the one i bought 200 piece.. 1.500 pieces are on the way.. yeah there are hundreds of them.. all have skype and live chat.. so you can ask whatever you want.. they reply immediately.. but when you want some feature they all say "yes yes we can do it" but not :))) , some of them made me crazy.. :) thank you very much.. i am not the hardware guru.. my friend "sevan" is the pcb designer.. i am just the guy that say "use vs1053b, atmel cpu , these features etc.." he made it all.. i coded the software.. soldering of the final pcb is handmade :) he was like an artist.. :)) if you can send the patch code and if you know how to implement a vumeter, that would be cool.. i am very tired of reading mcu documentations.. :)) my expertise is on gesture, pattern, object recognition and multimedia development on pc.. not micro controller developer :))

#18 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 14 March 2012 - 01:36 PM

yes thats the one i bought 200 piece.. 1.500 pieces are on the way..

Hmm...planning to sell those are you?

#19 Serkan Polat

Serkan Polat

    Member

  • Members
  • PipPip
  • 17 posts

Posted 14 March 2012 - 03:16 PM

No :) we will give free to our customers when they get our service for 1 year :)) Normally the most problem part is the hardware cost in our business, we use atom based ultra thin pc and windows.. İt cost alot.. Our customers dont want to make that investment.. Thats why we are teing to make our own hardware

#20 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 14 March 2012 - 07:48 PM

Very clever, h/w cost will be much smaller this way. So for a periodic fee you are like pushing out a music stream to play in stores, shopping centers and such or are you targeting consumers? Btw, you got a personal message.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.