PDA

View Full Version : Ok. It's time to ask about talking/listening to a Raspberry Pi



jimseng
- 3rd July 2012, 11:08
Mucking about with my Raspberry Pi yesterday I managed to get it chatting to my pc via serial using a max3232cpe. That was easy. I would like to get it to talk to a Pic now and being a bit ignorant I thought I would ask some questions.
To start with I am going to use a pic18f24k22 because it has some lovely hpwm so I can muck about with my rgb led strip.
I have done some serial interfacing with pics using serout. I guess this would work but it seems there must be a simpler way rather than going via a max3232cpe. And in order to use hserout I think I need yet more circuitry to interface properly which I am still trying to learn about. (but we could start there I suppose).

How about IC2 / SPI? I haven't done this before but would this be a good solution?

Any help would be appreciated. Surely we could have some fun?

HenrikOlsson
- 3rd July 2012, 12:59
Hi,
Since you apparently needed a levelshifter/inverter to get the Pi talking to the PC it means that it must output a non inverted signal at logic level (3.3V?) - which is exactly what the USART in the PIC outputs and expects as input (on some PICs you can even invert in hardware if needed). So, it should just be a matter of connecting TX to RX, then you could use HSERIN to receive data from the Pi - for example.

/Henrik.

jimseng
- 3rd July 2012, 14:17
Yes it is 3.3v from the Pi.
so just to be absolutely sure....because the Pi has no protection and is not 5v tolerant....I am unlikely to blow up my pi if I directly connect it to my pic18f24k22? (I won't be holding you responsible!) I thought that pics worked at 5v. I just want to make sure is all :-)

mackrackit
- 3rd July 2012, 14:41
Do not take this wrong, but it seems you need to learn a little more about your hardware before you go advanced.

Take a look at the PIC's data sheet under electrical and you will find the voltage vs speed.

jimseng
- 3rd July 2012, 17:31
Hmmmn.
I can take a look at the data sheet but not really understand it. What exactly am I looking at? I have always found I can understand about 0.2% of the data sheet.

mackrackit
- 3rd July 2012, 17:42
The 18F24K22 has an operating voltage of 1.8 to 3.6 volts as is. When you open the data sheet this information is on page #1 (pdf page #3)
Then look at section 26.

So run the 18F24K22 at the rated voltage and you should be fine.