Page 20 of 23

Re: PIC18F25K22 UART ERROR

Posted: Tue Sep 03, 2024 8:12 pm
by SILVESTROS
Hi,
I was finished hardware of transmitter and partial of receiver
Maybe tomorrow I'll test the codes for pair transmitter/ receiver for FSR sensor...
I was made a change for PIC in that pair. Instead of PIC 16F18313 I'll use PIC12F1822.

Basil

Re: PIC18F25K22 UART ERROR

Posted: Tue Sep 03, 2024 9:28 pm
by SILVESTROS
Hi,
The small transmitter uses NRF24L01 module to send data to receiver . MCU converts analog value of an FSR sensor to SPI....Receiver gets data and converts to an Analog value .
In the second pair I'll try to use a MAX30100 pulse /oximeter sensor , to make that wireless..

Basil

Re: PIC18F25K22 UART ERROR

Posted: Tue Sep 03, 2024 9:31 pm
by chipfryer27
Hi

I did dig out my tranceivers but I've not yet had a chance to play. Hopefully I'll get a chance later this week.

Regards

Re: PIC18F25K22 UART ERROR

Posted: Sat Sep 07, 2024 1:38 pm
by SILVESTROS
Hi,
I was made some tests to first pair (Analog to SPI/ SPI to Analog), In transmitter, I connect an FSR sensor to A1 of PIC12F1822 . I have +3,2V at V+ of NRF24L01 and PIC12G1822. The same at receiver.. I have no data (Analog value of FSR). The current of power supply at NRF24L01 is 0 , instead of some mA.
I noticed that CE pin of NRF24L01 in hardware ,is not connected at pin A0 according to properties, but is tied permanent at V+, as it seems at schematic that I send in my previous posts. Is that correct , or must be a connection CE pin of NRF24L01 with pin A0 of PIC12F1822? Tha same for receiver.
Before test of code , must be checked that NRF24L01 is enabled and works normally.
Is there a way to test that module ?
Many thanks

Basil

Re: PIC18F25K22 UART ERROR

Posted: Sat Sep 07, 2024 2:05 pm
by chipfryer27
Hi

As far as I remember from datasheet, the CE pin is used to as a means to tell the chip that it is in Rx or Tx mode.

With CE high it is in Rx mode
With CE low it is in Tx mode

Therefore it makes sense for your board to have this pin tied to VCC through a pull-up.

Note though that you should not have it in Tx mode for more than a few mS at a time.

Still hoping to get a chance to refresh my memory with these soon. The WiKi has a couple of examples to get you going I believe.

Regards

Re: PIC18F25K22 UART ERROR

Posted: Sat Sep 07, 2024 2:42 pm
by SILVESTROS
Hi,
Thanks for info..I'll make the changes in hardware about CE pin for transmitter/receiver..Wiki helps me to make the code for both .
It's simple for that pair, but first I must correct hardware.

Regards

Basil

Re: PIC18F25K22 UART ERROR

Posted: Sat Sep 07, 2024 7:19 pm
by SILVESTROS
I think that there is something wrong with connections between PIC and NRF24L01.
I'll check first the first pair ANALOG TO SPI and SPI TO ANALOG.
PIC12F1822 as SPI MASTER
CONNECTIONS
PIC NRF
PIN A.5 MOSI
PIN A.4 MISO
PIN A.3 SCK
PIN A.1 CSN
PIN A.0 CE
According to PIC12F1822 data sheet , pin A5 can't set with software channel , so there is no enough pins to connect with NRF and have an extra pin as input for FSR. Therefore I must select another chip.
For second pair I2C TO SPI , I use PIC16F1847 , so there is no such problem..I'll test that pair when I solve above problem with hardware modifications.
Regards
Basil

Re: PIC18F25K22 UART ERROR

Posted: Sat Sep 07, 2024 8:05 pm
by chipfryer27
Hi

Personally when "developing / experimenting" I tend to use a powerful chip that usually in many respects is overkill for the actual task in hand. That way I can concentrate on getting things "right" and to learn about the task intricasies without worrying too much about pins and things. Also, I'm too lazy to change the chip already in the multi-programmer :)

Once I'm sure I have things in hand I then look for a more suitable chip.

I'll try tomorrow to get to the "Evil Lab" and have a play, but as Sotland is in the height of summer, two days of consecutive sunshine, I may not make it :)

Regards

Re: PIC18F25K22 UART ERROR

Posted: Sat Sep 07, 2024 8:46 pm
by SILVESTROS
Hi,
You have right , but in that case I've the problem of "tight" space , especially at transmitter that must be very small.
In second pair, I use PIC16F1847 , no such problems , but there is no space for the same chip for the first pair.
I try to use a chip SOIC-8, but with 4 pins that use SPI, and no use of pin A.5 in that case, I need a trick..
I your opinion can I set pin CE of NRF24L01 as HIGH or LOW according to RX,TX , and no connect to PIC ? It's about power consumption ? NRF24L01 data sheet has no details about that.
Regards
Basil

Re: PIC18F25K22 UART ERROR

Posted: Sat Sep 07, 2024 9:34 pm
by mnfisher
I remembered seeing an Attiny85 being used to do this..

See https://www.google.com/amp/s/www.instru ... _page=true

Though this might not be the original source of the memory.

Martin