Pages: [1]   Go Down
Author Topic: Port manipulation on arduino mega 2560  (Read 84 times)
0 Members and 1 Guest are viewing this topic.
São Paulo / Brasil
Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

I want use the library "jeelib.h" to control a RFM12B.

I'm using the pin 69 (A15) as SS and need change the library to set this pin.

I found that should be "K" instead "B" on this part but,  I'm not sure.

https://github.com/jcw/jeelib/blob/master/RF12.cpp#L35

Code:
#if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)


#define SS_DDR      DDRB
#define SS_PORT     PORTB
#define SS_BIT      0

I don't know if "SS_BIT" should be zero.

Please someone can help me?

Thanks in advance.

Fernando Garcia
Logged

Conheça uma nova opção Open Source para controlar seu aquário: www.ferduino.com

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually, pin A15 on the MEGA 2560 is PORTK bit 7.

This may come in handy:  https://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0


However, I wouldn't necessarily define it this way. Perhaps B10000000, 0x80, or 128 might be preferred, because it's already in the same boolean form that PORTK will be in. In one case I used a bit shift operator 1 << BIT so that setting BIT to 7 would shift 1 over 7 places.
Logged

São Paulo / Brasil
Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

Understood.

Thank you very much!

Best regards.

Fernando Garcia
Logged

Conheça uma nova opção Open Source para controlar seu aquário: www.ferduino.com

Pages: [1]   Go Up
Jump to: