nRF T click panel doesn't work

Discuss with MikroElektronika software developers about current library development.
Post Reply
Author
Message
sztp
Posts: 6
Joined: 24 Jun 2013 14:54

nRF T click panel doesn't work

#1 Post by sztp » 24 Jun 2013 15:23

Hi,

I tried to use nRF T click panels. I connected one of them to my EasyPIC pro v7 board with 18f87k22 controller 16MHz, and the other to my own mcu panel (18f45k22 / 20MHz). I set the pro V7 side to tx mode and the other to rx mode but they don't work together. I use the mikroC official demo software. I modify a little the program according to the difference between two controllers (ANCON instead of ANSEL).

Should I adjust the project's clock rate in case of 20MHz frequency? How can I test the spi connection simply?

Regards,
Peter

User avatar
milos.vicentijevic
Posts: 965
Joined: 23 Apr 2013 08:09

Re: nRF T click panel doesn't work

#2 Post by milos.vicentijevic » 25 Jun 2013 10:39

Hello Peter,

if you change your oscillator crystal, you have to change project oscillator frequency as well (Project->Edit Project) . I suggest you to check other settings concerning oscillator settings as well. If Oscillator Frequency (in Project->Edit Project) does not match real speed of your MCU, all time critical operations will be messed up and wrong calculated in your compiler, so on example Delay_1sec(); will less shorter or longer but it won't less exactly 1 second like it should.

The best way to test are your settings good is to make 2 versions of simple program (one for each board) that work with UART so, when each board is turned on (or reset) it sends UART Ready! message or similar over UART. If letters are displayed correctly all oscillator settings are good. if you are getting same letters that doesn't make sense, something is wrong with your oscillator settings.

Please check this first, and see what is going to happen.

Best Regards,
Milos Vicentijevic

sztp
Posts: 6
Joined: 24 Jun 2013 14:54

Re: nRF T click panel doesn't work

#3 Post by sztp » 26 Jun 2013 21:47

Hello Milos,

thank you for your fast reply. I haven't any problem with UART, both panels send the appropriate datas to my computer. Could you send me any solution for testing the spi connection between my panels and the nRF click?

Thank you,
Peter

User avatar
milos.vicentijevic
Posts: 965
Joined: 23 Apr 2013 08:09

Re: nRF T click panel doesn't work

#4 Post by milos.vicentijevic » 27 Jun 2013 14:23

Hello,

It's good if UARTs are working properly.

Have you changed interrupt routines so they work the same way on 18f87k22 ?

If you didn't please check datasheets of those two MCUs and make some adjustments in code if needed. (code for 18f87k22) Also due difference of oscillator settings will be different.

Great help for timer interrupts you can have with use of software called timer calculator. It is free of charge and can be downloaded from Libstock:

http://www.libstock.com/projects/view/3 ... calculator

Best Regards,
Milos Vicentijevic

sztp
Posts: 6
Joined: 24 Jun 2013 14:54

Re: nRF T click panel doesn't work

#5 Post by sztp » 28 Jun 2013 11:23

Hello Milos,

I adjusted the settings according to your help but the problem is the same: no connection.
I attach the two modified main.c code. I commented all modifications (timer settings and pinout difference).

What else should I do?

Thank you and best regards,
Peter

sztp
Posts: 6
Joined: 24 Jun 2013 14:54

Re: nRF T click panel doesn't work

#6 Post by sztp » 28 Jun 2013 11:27

Hello Milos,

Here is the code.

Regards, Peter
Attachments
nRFT.zip
(4 KiB) Downloaded 281 times

sztp
Posts: 6
Joined: 24 Jun 2013 14:54

Re: nRF T click panel doesn't work

#7 Post by sztp » 02 Jul 2013 21:45

Hi Milos,

I've recognized that I can get the channel's number in L01_api.c. So I could test the SPI connection, and I corrected my error. Now the connection ok, but I have a problem:

Everything is ok in one direction, but in the other direction (from 18F45K22/20MHz to 18F87K22/16MHz) the transmitter couldn't send datas. It writes when I switch it to TX mode:

MAX_RT!
ARC: 15
PLOS: 10

Could you help me?

Thank you and best regards,

Peter

sztp
Posts: 6
Joined: 24 Jun 2013 14:54

Re: nRF T click panel doesn't work

#8 Post by sztp » 03 Jul 2013 10:25

Hello Milos,

Ok, I've figured out. I use RB1 for external interrupt in mikrobus 2 and when I changed the main program's interrupt settings (INT1IE instead of INT0IE) the problem had solved.

Regards, Peter

User avatar
milos.vicentijevic
Posts: 965
Joined: 23 Apr 2013 08:09

Re: nRF T click panel doesn't work

#9 Post by milos.vicentijevic » 03 Jul 2013 11:55

Hello Peter,

I'm glad you figured it out faster than me. :D
Please note that there are also timer settings in L01_api.c (around line 310 of code). They are needed for RX side so if you didn't change those values when you were using Timer Calculator, you can try to change them too and see does it works any better.

Best Regards,
Milos Vicentijevic

Post Reply

Return to “Library Development Discussion”