reaper7 67 Posted November 9, 2015 Author Share Posted November 9, 2015 Hi! - I don't know how to help You, a good choice is to buy a simple logic analyzer. Do You have any message on serial console? Try to "enable" debug message from lib -> EtherEncLib.h change DEBUGLIB value from 0 to 1 (line 40) You must know how to check process step by step, simplest method is inserting something like this Serial.println("i'm here"); in different library places (like begin, available etc) called from sketch. You must be like a Herlock Sholmes yosh and lessarlz 2 Quote Link to post Share on other sites
reaper7 67 Posted November 16, 2015 Author Share Posted November 16, 2015 bump! new 0.4.2 version - fixed CS pin inside enc28typedef.h yosh and bluehash 2 Quote Link to post Share on other sites
lsl4578 0 Posted November 21, 2015 Share Posted November 21, 2015 Hello, I managed to install and make the examples work on my MSP430, good stuff! I got one question: I'm trying to set a MSP430 pin as an output, and control the logic value of this pin using my Browser, having the MSP430 as an web server, for example. Could anyone give me a good start on this? Thanks! Quote Link to post Share on other sites
reaper7 67 Posted November 22, 2015 Author Share Posted November 22, 2015 examples->HelloWorldActivate.ino allows You control RED_LED on MSP430G2 yosh and lsl4578 2 Quote Link to post Share on other sites
DanielPHuber 16 Posted March 14, 2016 Share Posted March 14, 2016 The following concerns Energia 0101E0017 on Windows 10 and EtherEncLib-0.4.2 Launchpad MSP-EXP430G2 with a MSP430G2553 Hi Reaper, thanks a lot for the library. However, I had a bad start. To begin with, I was not able to get the smallest answer from it. Of course, I suspected the SPI interface, but was barking up the wrong tree. Not until I began to dig into the library I stroke gold. The first problem was a function "F" used in print context like e.g. ? Serial.println(F("Text to print")) I never encountered this function bevor with MSP430G2553, I do not know what it does, but it compiles. However, after replacing all occurrences of this function , oh wonder, nearly everything worked! The second hickup I encountered, was the chip (or slave, CS or SS) select pin (in my case pin 10) in the examples. Although the sketch sets this to output mode, it does not set it to "LOW". Without setting this pin to low, I did not receive any answer from the library. I think the SPI started up in "slave" mode. This CS pin is rather finicky, I fail to understand it. The pin reference in "energia.nu" for MSP430G2553 specifies that the SPI library uses P2.0 as CS, but this dos not work, neither does P2.1. However P2.2 works, why? It would interesting if you could comment. cheers, Daniel Quote Link to post Share on other sites
reaper7 67 Posted March 15, 2016 Author Share Posted March 15, 2016 @DanielPHuber 1. "F" is declared in ...cores/msp430/WString.h and generally refers to strings stored in flash memory. If You can know more, read about FlashStringHelper and PSTR 2. This lib uses "user defined" CS pin and control it from library, not from msp hardware of course You can change it to other pin but remember, that You must change this in two places: - in Your sketch, through properly set pin mode eg: pinMode(10,OUTPUT) - in enc28typedef.h inside this library folder: #define ENC28J60_CONTROL_CS 10 At this moment personally I use pin 13 and it works too so...I can move CS pin mode initialization to library (remove pinMode from user sketch), this is almost done but at this moment this mod is commented and I want to maintain the highest compliance with the original library. yosh and Fmilburn 2 Quote Link to post Share on other sites
DanielPHuber 16 Posted March 15, 2016 Share Posted March 15, 2016 Hi Reaper, thanks a lot, I learned a thing ot two. There is nothing wrong with the library, I must have fooled myself yesterday. Anyway, today the library works with F(..). However, I do not yet understand fully what F(..) does on the MSP430. On the Arduino we have a Harvard architecture, that means separate address spaces for code and data. Therefore before using "print " to print a string in code segment, we must trick "print" into fetching the string from code and not data space. must first be copied into data segment. Here F(..) makes sense. However, MSP430 is von Neuman, that means there is only one single address space for both data and code. Therefore there is no problem accessing something in the code segment. What does F(..) in this case? Is F(..) on the MSP430 superfluous? Does it add superfluous code? thank's for the teaching, Daniel Quote Link to post Share on other sites
chicken 630 Posted March 15, 2016 Share Posted March 15, 2016 There's probably a #define somewhere in an Energia header file that makes F() do nothing. This makes it easier to reuse libraries and code originally created for Arduino. Fmilburn 1 Quote Link to post Share on other sites
reaper7 67 Posted March 16, 2016 Author Share Posted March 16, 2016 @@chicken - as I wrote above F("zzz") is declared in WString.h as: #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal))) @@DanielPHuber - I don't know if F is necessary for MSP and even I don't go deep into it (FlashStringHelper or PSTR) if the library compiled and works I don't know too how (or even) this affects performance and/or memory usage. Can You tests memory usage and performance with and without "F" ? yosh 1 Quote Link to post Share on other sites
chicken 630 Posted March 16, 2016 Share Posted March 16, 2016 @@reaper7 A sorry, didn't pay attention to the whole thread. PSTR is Atmel's way to identify pointers to program memory. Energia has a define somewhere to ignore PSTR. So F() in the end does nothing to the string pointer. It doesn't have to, thanks to MSP430's sane memory model. F() can safely be left away for MSP430. reaper7 1 Quote Link to post Share on other sites
reaper7 67 Posted March 16, 2016 Author Share Posted March 16, 2016 @@chicken - tnx for explain Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.