Jump to content

  • Log In with Google      Sign In   
  • Create Account

Photo

[Energia Library] VirtualWire 1.10 library ported to MSP430/Energia


  • Please log in to reply
22 replies to this topic

#1 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 09 January 2013 - 03:10 PM

Hi!

 

I am proud to share with you the result of my work during this afternoon.

This code is some kind of beta as I have not tested everything.

I have done a successful communication between a MSP430G2452 driving a cheap 433 Mhz transmitter to a Arduino Nano listening the receiver.

I have not tested the client/server examples but I will try it soon with some 2,4GHz modules I have.

The code compiles on both MSP430G2452 and MSP430G2553 but the latter has not been tested.

 

Apart from understanding what was done by the code, my work has been to change the timer and interrupts codes from AVR to MSP430, and to port the crc16.h AVR/libc library to Energia (mostly rewriting no real coding).

 

Comments are welcome of course.

I will try to make the same code working on both Arduino and Energia/MSP430 later.

 

The link to download is at the bottom of this blog article :

http://xv4y.radioclu...pour-le-msp430/

 

The original documentation applies :

http://www.open.com....VirtualWire.pdf

http://www.open.com.au/mikem/arduino/

 

Yan.


  • bluehash, Rickta59, pine and 3 others like this

---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#2 RichardVowles

RichardVowles

    Level 1

  • Members
  • 78 posts

Posted 10 January 2013 - 03:28 AM

Their prices have come down on Aliexpress - 5 pairs are only US 69c a pair.



#3 Rickta59

Rickta59

    Level 3

  • Global Moderators
  • 748 posts
  • LocationEastern NC


Posted 10 January 2013 - 05:06 PM

When I started contributing to the Energia project this is the kind of end result I envisioned. Many users building on a common platform and everyone benefiting. I'm happy you were able to get this going. One less thing I will have to write for myself!

Thanks for sharing!

-rick

#4 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 11 January 2013 - 03:19 AM

Hi Rick,

 

Thanks for this comment.

I am happy too ;-) That was more than 10 years I have not been really working with micro-controlers.

Now they are far more powerful and that gives a lot of flexibility.

For me, Arduino has really changed the deal because you can now mix low level and high level programming allowing both new-comers and experimented developers to do interesting things together.

Energia is a great project first because the MSP430 has its own advantages in some applications in front of the AVR. Now making it working also on Stellaris will sure make more community projects (including Arduino, Arduino Due, MSP430, Stellaris...) even more fruitful.

 

About sharing, well since this code was in GPL I had no choice ;-)

However I think working on an open platform one should contribute to the community.

I will not publish all my codes, but as much as I can will try to do it for the libraries I will be working on in my projects.

 

Yan.


---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#5 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 14 January 2013 - 07:39 AM

Hi,

 

The original author has now published version 1.12 of the library that should work on both Arduino (ATMega328) and Energia (MSP430G2452/G2553).

Examples are provided for both platforms.

 

Download is possible on the author's website.

 

Comments and feedback are welcome.

 

Yan.


  • energia likes this

---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#6 demon1977

demon1977

    Noob Class

  • Members
  • 3 posts

Posted 22 January 2013 - 01:11 PM

Hi,

Version 1.12, the code no compiles:

 

 

 

C:\energia\hardware\msp430\libraries\VirtualWire\VirtualWire.cpp:32:24: fatal error: util/crc16.h: No such file or directory
compilation terminated.

 



#7 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 22 January 2013 - 01:31 PM

Hi demon 1977 (great year),

 

Perhaps the author forgot to include my port of the crc16.h library. Try to download my first version of the VirtualWire library (the first link on the first post here above). You will find the util directory you can copy in the library directory.

If this not work either, try to use my library as this one is tested...

 

Yan.


---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#8 demon1977

demon1977

    Noob Class

  • Members
  • 3 posts

Posted 22 January 2013 - 01:40 PM

Hi Yan, I did not find the download link.:(



#9 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 22 January 2013 - 01:50 PM

Here the last "library pack" I uploaded :
http://xv4y.radioclu...4y_20130109.zip


---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#10 demon1977

demon1977

    Noob Class

  • Members
  • 3 posts

Posted 22 January 2013 - 01:55 PM

There's no file crc16.h



#11 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 23 January 2013 - 09:06 AM

Hi,

 

I have updated the package on my download page :

http://xv4y.radioclu.../boutique/docs/

 

Yan.


  • energia and demon1977 like this

---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#12 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 26 January 2013 - 07:24 AM

Mike McCauley, the original author, has added the missing files in the new 1.13 release...

 

Yan.


---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#13 dodgecandle

dodgecandle

    Noob Class

  • Members
  • 1 posts

Posted 15 February 2013 - 09:23 PM

Hello there,

 

first of all, many thanks for your fantastic work, I have downloaded and installed latest version of VirtualWire library 1.14 et when trying to compile with Energia 009 I get the following errors:

..\VirtualWire.cpp:568:7: error: expected constructor, destructor, or type conversion before '(' token
..\VirtualWire.cpp:648:1: error: expected '}' at end of input

 

Any advices?

Thanks in advance



#14 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 26 March 2013 - 03:00 AM

Hi all,

 

It seems that the original author as merged my code but not tested it compiling nor working.

This my original port that works on G2553 and G2452.

 

http://xv4y.radioclu...nergia_XV4Y.zip

 

Yan.


---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#15 WarEnd

WarEnd

    Noob Class

  • Members
  • 9 posts

Posted 27 March 2013 - 11:11 AM

Hi. Thanks :smile:

 

Its compiles and run on msp430g2553 :smile:

 

Except on msp430g2452 i get:

 

core.a(TimerSerial.cpp.o): In function `TimerSerial__TxIsr':
/home/warend/energia-0101E0009/hardware/msp430/cores/msp430/TimerSerial.cpp:213: multiple definition of `__isr_9'
VirtualWire/VirtualWire.cpp.o:VirtualWire.cpp:(.text.Timer_A_int+0x0): first defined here
collect2: ld returned 1 exit status

 

This error maybe because 2452 have only one timer ???

 

I buy many msp430g2452 chips, and cheap rf 315mhz from ebay: and now tray to compile virtualwire for my projects :-(

 


 



#16 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 27 March 2013 - 01:40 PM

Hi,

 

Which file do you use for the library. Where did you downloaded it.

I remember having the same error because in one library (which one ???) some debug code containing serial.print was left.

Try to track the "TimerSerial" in the library you use and disable it...

 

Yan.


---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#17 WarEnd

WarEnd

    Noob Class

  • Members
  • 9 posts

Posted 27 March 2013 - 04:24 PM

Hi,

Thanks compiles on msp430g2452 :)

 

Remove all Serial.print in provided example :)

 

Now I test if I can use with nokia 5110 lcd with same chip :)



#18 Mau

Mau

    Noob Class

  • Members
  • 2 posts

Posted 21 December 2013 - 03:25 PM

Hello,

 

Some people in this post had problems compiling the VirtualWire using Energia. This happened to me too. I was using the VirtualWire 1.20 from airspayce.com. According to the release history this version should contain support for the MSP430. I don't think it is true, I was only able to compile using the version from xv4y.radioclub.asia.

 

I have now a different problem. I was able to compile the examples provided by the package (the transmitter and the receiver). I am using a pair of lauchpad G2553 and a MX-FS-03V as the transmitter and a the MX-05V and the receiver. The MX-V05V needs 5V to work. I am using the TP1 from the Lauchpad as the 5V VCC for the transmitter.

 

The problem is the MSP430 working as a receiver doesn't do anything. To clarify, it lights a steady red led and stays like that. Open the serial monitor you only see the setup coming out but no other data. I know that the transmitter and the receivers work because I've tested them in a arduino.

 

I tried to troubleshoot by connecting the TX pin from the MSP430 into the RX pin of the other directly (without using the MX circuits) using a common ground.

 

Any ideas what could be happening?

 

I tried to google to see VirtualWire and the MX circuits working. I got tons of examples using arduino but I haven't seen anything (with enough details) for the Lauchpad MSP 430.

 

Thanks in advance for the help!



#19 xv4y

xv4y

    Level 1

  • Members
  • 102 posts
  • LocationViêt-Nam

Posted 22 December 2013 - 12:00 AM

Hi Mau,

 

Usually, mixing 5V and 3,3V parts withtout level converter is not recommended.

By example the 5V part may need to see 3,2V to consider it as HIGH, while the the 3,3V will put out a 3,1V signal at max.

The 5V part outputs putting 5V into the MSP430 inputs may also fry the latter.

 

It can work, I am successfully driving a 5V AD9850 with a 3,3V MSP430G2553, but you need to carefully check the "compatibility".

 

Regards,

Yan.

---

http://xv4y.radioclub.asia/


---
Yannick DEVOS - XV4Y

http://xv4y.radioclub.asia/


#20 Mau

Mau

    Noob Class

  • Members
  • 2 posts

Posted 22 December 2013 - 01:30 AM

Hi Yan,

 

Point taken. I completly neglected the voltage difference. However, could you tell me why when I direct feed the output pin from one MCU into the input pin to the second controler using a common ground between the two it didn't work? In this particular case only 3.3 V apply.

 

Also. Do I have to use a level converter? What if I feed the receiver with 5V (from TP1 from the USB connector of the LAUchapd) and i use a voltage divider circuit for the output of the receiver into the Launchpad?

 

Do you think it may work?

 

Thanks,

 

Mau






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users