I am trying to get a serial connection between an RaspberryPi and a Picaxe 18M2 Microcontroller. I found out that I should build the following cirucit because the Rasperry and the Microcontroller have different levels.
So here is a picture of my attempt to build this circuit.I checked it several times but maybe I made a mistake anyway (If needed I will send more pictures):
I have the following code, that run's on the Picaxe 18M2 Microcontroller
main: 'high B.3 'green led 'high B.0 'red led serout C.3,N4800,(10,13) 'Start a new line serout C.3 ,N4800,("Press a key- ") ' Send a message serin C.4,N4800,b1 ' Receive a character into variable b1 serout C.3,N4800,(b1) ' Transmit character back to the screen if b1="a" then hot ' Is character ?a?? If yes goto hot goto main 'No, so loop back to start hot: serout C.3,N4800, (10,13,"A is the Hot Key!") high B.0 pause 5000 low B.0 pause 5000 high B.0 goto main ' Loop back to start
I tried to connect over putty on my PC about the same serial connection I use to program the microcontroller. So i open a serial connection with putty on my COM1 Port with a baud rate of 4800. There the programm works. Not perfectly but it works and i am able to highlight a red led when i enter an "a". When I'm opening a serial connection on the Raspberry with minicom on /dev/ttyAMA0 I'm just getting back some weird charachters and it seems like i'm not able to send a charachter back to the microcontroller. I also tried baud rates of 600,1200 and 2400. I event tried it with picocom but that doesn't work either. Does anybody have an idea what I could be doing wrong?