Project

General

Profile

Resolved - RFM12 and LCD display are not working together...

Added by oppes about 6 years ago

Hello everybody,

I try to put togehter a RFM12 module with a LCD display. Every component itself is working without any problems, but if i put them together in the same code, the RFM12 is not working.
I am working with Arduino IDE 1.0.1, have this RFM12 module
http://www.pollin.de/shop/dt/OTI5OTgxOTk-/Bausaetze\_Module/Module/Funkmodul\_RFM12\_Sende\_Empfangsmodul.html
and this display
http://www.reichelt.de/Hintergrund-gruen/LCD-162C-LED/3/index.html?;ACTION=3;LA=446;ARTICLE=31653;GROUPID=3005;artnr=LCD+162C+LED;SID=12UCE9BX8AAAIAAGPhbdQda04b5072e2c4d15a101bfc74a38b393

My code is the following:

> #include
> #include
> LiquidCrystal lcd(7,8,5,4,3,2);
>
> int counter = 0;
>
> void setup () {
> > Serial.begin(57600);
> > Serial.println(" “);
> > Serial.println(”Setup“);
> >
> > // Initialize LCD
> > lcd.begin(16,2);
> >
> > // node 10, group 212, 868 MHz
> > rf12_initialize(10, RF12_868MHZ, 212);
> >
> > lcd.print(”Hello world“);
>
> }
>
> void loop () {
> > ++counter;
> >
> > while (!rf12_canSend()) {
> > > rf12_recvDone();
> > }
> > rf12_sendStart(0, &counter, sizeof counter);
> >
> > Serial.print(”sende: “);
> > Serial.println(counter);
> >
> > delay(1000);
> }
If I comment out
> lcd.print(”Hello world");
in the setup, the code is working again.

Does anybody has an idea what my problem is?

Any help will do, I am lost….

Thank you very much

Regards,
Josef

P.S.: I attached my codes so you can replicate my problem!

TX.ino (545 Bytes) TX.ino Transmitter
RX.ino (380 Bytes) RX.ino Receiver

Replies (21)

RE: RFM12 and LCD display are not working together... - Added by oppes about 6 years ago

Hi,

i do not get any errors.

It seems as the code simply stops during or after the command
> lcd.print(“Hello world”);
and nothing else happens. I also don´t get a printout of the counter in the serial monitor and the reveiver doesn´t get anymore signals

Sorry that I can´t be more specific..

Thank you in advance.

Regards,
Josef

RE: RFM12 and LCD display are not working together... - Added by gadjet about 6 years ago

Just a thought but have you tried to use the standard LCD parallel library: -

// include the library code:
#include

I use the PortsLCD.h when I’m using an I2C connected LCD, I use the Arduino one for a parallel connected LCD.

Worth a try?

RE: RFM12 and LCD display are not working together... - Added by oppes about 6 years ago

Yeah I did this, but no difference….

RE: RFM12 and LCD display are not working together... - Added by oppes about 6 years ago

Hello again,

I still have no clue what my problem causes.

I even tested the JeeLib example “rfRangeRX” which includes a lcd display, but I still get an error. For this example the code simply crashes and resets itself so the lcd is blinking with its setup print line.

Does anyone give an advice what else I can try…

Regards,
Josef

P.S.: maybe my circuit layout will help you (see attachment)

RE: RFM12 and LCD display are not working together... - Added by gadjet about 6 years ago

The only thing I can think of is that there may be a hardware problem.
What happens if you disconnect the LCD? Does the LCD work when the rfm12b is disconnected.

RE: RFM12 and LCD display are not working together... - Added by teding about 6 years ago

Using pin 2 for your LCD, and as interrupt for the RFM12
is properly causing your problems

RE: RFM12 and LCD display are not working together... - Added by oppes about 6 years ago

Hello,

thank you for your help.

The problem was using pin 2 for the lcd and for the rfm12 at the same time as teding was mentioning in post 7. I connected the lcd to pin 4 to 9 and now it is working.

But I still got some problems. Every 4th ot 5th time I turn on the power supply, the code crashes and is not getting out of the setup(). It is weird since it totally random when this is happening.

Does anyone has a suggestion for that problem too?

Regards,
Josef

RE: RFM12 and LCD display are not working together... - Added by martynj about 6 years ago

Try holding ⁊RESET at GND while you turn on the power supply, then release it to start the code.

RE: RFM12 and LCD display are not working together... - Added by oppes about 6 years ago

Hi again,

pressing the reset button while powering uo does not help.

I experience the problem after the follwoing sequence:
I upload my code with an USB BUB II from Modern Device. After disconnecting the USB BUB II I connect the 9V battery as shown in the picture of post 5 (“Transmitter_Steckplatine.jpg”). The code works correctly. But if I connect the USB BUB II again, the code crasches during initialization. No matter what I try, the code won´t run. Then I have to upload the “RF12demo” sektch and set the group, frequency and nodeID manually. After this, I can upload my original code and it is working until I try to connect the USB BUB II as described.

Does anyone has experience with this kind of behaviour?

Thanks,

Josef

RE: RFM12 and LCD display are not working together... - Added by gadjet about 6 years ago

I can’t say if I have exactly the same problem but I definitely have issues with my code not starting, even when I’m using a battery, sometimes I have to switch it off an on a couple of times to get it working but is quite rare.

RE: RFM12 and LCD display are not working together... - Added by JohnO about 6 years ago

Could you post your fuse settings?

RE: RFM12 and LCD display are not working together... - Added by gadjet about 6 years ago

I’ve never really looked at my fuse settings, they are whatever comes with the Jeenode, I wouldn’t know how to change them, I’d Google it if I needed to.

Sorry

RE: RFM12 and LCD display are not working together... - Added by oppes about 6 years ago

How can I check out my fuse settings?

RE: RFM12 and LCD display are not working together... - Added by teding about 6 years ago

You can download this sketch, and run it
Set your serial speed at 19200

Teding

https://github.com/WestfW/fusebytes

Ps Are you running the RFM12 at 5 volt?

RE: RFM12 and LCD display are not working together... - Added by oppes about 6 years ago

Hi,

thank you for your help.

Yes I am running RFM12 at 5V.

This is what I get when I try to read the fuses with the “fusebyte-sketch”.

Compiled for ATmega328P
No Serial Number

Fuse bits (L/H/E): FF D6 FD
Lock bits:         CF
Signature:         1E 95 F (ATmega328P)
Oscal:             85

Fuse Low = 11111111 (FF)
           ||||++++______Low Power Crystal 8 - 16MHz
           ||++__________Start Up Time=11
           |+____________Clock Output Disabled
           +_____________(no divide)

Fuse High = 11010110 (D6)
            |||||||+______Reset to Bootstrap
            |||||++_______256 words (512 bytes)
            ||||+_________EEPROM Preserved on chip erase
            |||+__________Watchdog programmable
            ||+___________ISP programming enabled
            |+____________DebugWire off
            +_____________RST enabled

Fuse Extended = 11111101 (FD)
                |||||+++______Brownout at 2.7V

Lock Bits = 11001111 (CF)
            ||||||++______Read/Write to everywhere
            ||||++________R/W Application
            ||++__________No Write to Boot, no read from App

Bootloader at 0x7E00 is not readable

I don`t know what this means, but I guess “Bootloader at 0x7E00 is not readable” is not a good sign

Regards,
Josef

RE: RFM12 and LCD display are not working together... - Added by JohnO about 6 years ago

Bootloader not readable just means that the fuses are set to deny the sketch access to that area of memory. If access was enabled it would have tried to guess at the bootloader version.

RE: RFM12 and LCD display are not working together... - Added by JohnO about 6 years ago

Looks like there is a tweak to allow reading of the bootloader version. http://osdir.com/ml/commits.gnome/2012-03/msg13990.html

RE: RFM12 and LCD display are not working together... - Added by teding about 6 years ago

Oppes,

The rfm12 is designed for 3.3V.
I think your problem whith the rf12_initialize is cause by that high voltage.
Take a look at this board
http://jeelabs.com/products/rfm12b-board

Teding

RE: RFM12 and LCD display are not working together... - Added by martynj about 6 years ago

@Oppes, the original RFM12 is spec’d for  Absolute Max (damage will occur at or beyond) of  6.0V, operating 2.2 - 5.4V, the later derivative RFM12B has the same Absolute Max and operating 2.2 - 3.8V.  
It is not clear why the recommended upper limit was reduced, the silicon process was not changed AFAIK and of course the power  dissipated in the final transmitter stage goes up ~ proportional to the square of the supply voltage - there may have been some reliability issues at full power rail, full transmit output, especially with poorly matched aerials.

The RFM12B sits on INT0 (ATMega p4 on a standard JeeNode), INT1 is available from p5 as the IRQ line in every header.  Keep the two interrupt activities apart by using this partitioning - RF12 library default assume INT0, check and/or change what your  LCD support library is set to.

RE: RFM12 and LCD display are not working together... - Added by oppes about 6 years ago

Good evening,

I found a solution for my problem.

It is some kind of software problem. I inserted a
> rf12_recvDone();
after the
> rf12_initialize(TXNodeID,Freq,Networkgroup);
and it works. I can unplug and reconnect the USB-BUB II or a external power supply and the code starts without any problem.

teding: I tried to run the RFM12 (without B) at 3.3V but it does not work. I counld`t even start the RF12_demo sketch.

Now that my code is working thanks to all of you, I have one last question.
Is there a way to speed up the transmission? It takes about 1 to 6 ms to send the date. I am trying to trigger a flash and therefore it would be great if the transmission was faster than 1 ms.
I am using the folling code to send the data:

while (!rf12_canSend()) {
        rf12_recvDone(); 
}
rf12_sendStart(0, &TX_Data, sizeof TX_Data);

Thanks everybody for your help.

Regards,
Josef

    (1-21/21)