Virtual Wire lib for CHIPKIT

Work prioritization by the chipKIT core development team
PICedh
Posts: 64
Joined: Tue May 15, 2012 8:17 pm
Location: Paris
Contact:

Virtual Wire lib for CHIPKIT

Post by PICedh » Fri Apr 03, 2015 11:23 am

Hello,

I have adapted the Arduino Virtual Wire lib for CHIPKIT? this lib. This lib is very helpfull for a very low cost transmission between 2 shields.
I have also improved the lib by adding functions that transmitt float and indicate source and type of data.

More details here: http://chipkit.net/virtual-wire-lib-for-chipkit/

Are you interested to include this lib in the next Chipkit release ?


Eric
RobotEdh: My first Robot is controlled by a chipKIT Max32

guymc
Posts: 98
Joined: Mon Sep 24, 2012 3:24 pm

Re: Virtual Wire lib for CHIPKIT

Post by guymc » Wed Apr 08, 2015 9:20 pm

Hi Eric,

Thank you for posting your work, and for suggesting that Virtual Wire be incorporated into the chipKIT software framework. I'll ask the Steering Committee to look into this at the next opportunity.

Cheers

User avatar
Jacob Christ
Posts: 723
Joined: Sat May 28, 2011 6:34 am
Location: Southern California
Contact:

Re: Virtual Wire lib for CHIPKIT

Post by Jacob Christ » Sat Apr 25, 2015 11:41 pm

Seems like a great thing to include. Any suggestions on how to do this, in the core libraries?

Jacob
PONTECH Quick240 an industrial form factor platform for chipKIT and Arduino users.

User avatar
Jacob Christ
Posts: 723
Joined: Sat May 28, 2011 6:34 am
Location: Southern California
Contact:

Re: Virtual Wire lib for CHIPKIT

Post by Jacob Christ » Sat Apr 25, 2015 11:43 pm

We have this lib repo we haven't done much with either...

https://github.com/chipKIT32-libraries

Jacob
PONTECH Quick240 an industrial form factor platform for chipKIT and Arduino users.

User avatar
Jacob Christ
Posts: 723
Joined: Sat May 28, 2011 6:34 am
Location: Southern California
Contact:

Re: Virtual Wire lib for CHIPKIT

Post by Jacob Christ » Sat Apr 25, 2015 11:47 pm

So I was looking at your code and noticed you had a line with a comment that says "comment this out if your not chipkit"

When I ported the cryposuite lib for Arduino to chipKIT I added this:

#if defined(__PIC32MX__)
#define PROGMEM
#define memcpy_P(dest,source,len) memcpy((dest),(source),(len))
#define pgm_read_dword(address) (uint32_t)(*(address))
#else
#include <avr/io.h>
#include <avr/pgmspace.h>
#endif

This way its just detected. However, there are not PIC32MZ parts in the mix an this may not be the best way to do this. I'll try to get some smarter people to look at this post.

Jacob
PONTECH Quick240 an industrial form factor platform for chipKIT and Arduino users.

EmbeddedMan
Posts: 597
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: Virtual Wire lib for CHIPKIT

Post by EmbeddedMan » Sat Apr 25, 2015 11:51 pm

If we don't have some sort of
#define CHIPKIT
that we can test in our code, we really should have.

*Brian

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Virtual Wire lib for CHIPKIT

Post by majenko » Sat Apr 25, 2015 11:57 pm

You can check for __PIC32MZ__ as well as __PIC32MX__ I believe.

You can also look for sub families too, like __PIC32MX1XX__

Check in the cpudefs.h file in the core for all the funky defines.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Virtual Wire lib for CHIPKIT

Post by majenko » Sat Apr 25, 2015 11:59 pm

I think I got Jason to add a chipKIT or similar defines to the compiler so we can tell it apart from XC32.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Virtual Wire lib for CHIPKIT

Post by majenko » Sun Apr 26, 2015 12:47 am

I can't see the CHIPKIT define in the compiler I'm using on UECIDE, and I thought that was the absolute latest. Instead it has the XC32 define back in there. I'll check with Jason to see if that got missed. It was definitely there at one point.

There is, however, some other useful defines available:

Code: Select all

#define __PIC32
#define __PIC32__
#define PIC32

(if MX part is used)
#define __PIC32MX
#define __PIC32MX__
#define PIC32MX

(if MZ part is used)
#define __PIC32MZ
#define __PIC32MZ__
#define PIC32MZ
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

User avatar
Jacob Christ
Posts: 723
Joined: Sat May 28, 2011 6:34 am
Location: Southern California
Contact:

Re: Virtual Wire lib for CHIPKIT

Post by Jacob Christ » Sun Apr 26, 2015 1:43 am

Looks like PIC32 or __PIC32__ would be the ticket unless you need to target a specific family or chip.

Jacob
PONTECH Quick240 an industrial form factor platform for chipKIT and Arduino users.

Post Reply