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
PIC18F25K22 UART ERROR
-
- Posts: 120
- http://meble-kuchenne.info.pl
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 31 times
- Been thanked: 2 times
-
- Posts: 120
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 31 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
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
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
- Attachments
-
- IMG_20240903_210724.jpg (68.29 KiB) Viewed 3559 times
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: PIC18F25K22 UART ERROR
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
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
-
- Posts: 120
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 31 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
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
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
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: PIC18F25K22 UART ERROR
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
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
-
- Posts: 120
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 31 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
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
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
-
- Posts: 120
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 31 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
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
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
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: PIC18F25K22 UART ERROR
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
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
-
- Posts: 120
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 31 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
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
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
-
- Valued Contributor
- Posts: 1462
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 136 times
- Been thanked: 713 times
Re: PIC18F25K22 UART ERROR
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
See https://www.google.com/amp/s/www.instru ... _page=true
Though this might not be the original source of the memory.
Martin