Finally got the PIC18F25K20 on my PicNduino talking to a Nokia 5110 LCD which was given to me by a kind friend. I was determined to to bit bash the code and to use hardware SPI. This I have at last achieved.
The delay has been mostly due to digging through the Internet for proper PIC documentation. I’m not quite sure how they stay in business with such large amounts of poor docco that is so poorly linked to others. I feel the need for tutorials and generally clearing things up. Still they are way ahead of Texas Instruments who seem to drown in formal catalogued documentation that makes little clear.
Anyway, so I now know how to managed i2c and SPI plus LCD displays and thermistors and IR remote controls. I can do all this across Raspberry Pi, PiC and Arduino. I should be able to add TI’s micro-controllers to that soon.
The question now is what to do with it all? I might try blowing a stand alone PIC to do something. If that works then I might make a gizmo for my exercise bike that reads the sensors and outputs more intelligent data than the current computer display.
All baby steps so far but I’m getting there finally.
I’ve been playing with the Arduino and Raspberry Pi trying to get i2c working between them. The difference between 3.3v and 5v logic levels may be why so far I’ve had no success. So today I soldered some header pins onto the PICnDuino and connected that to the Arduino instead. Both operate at 5v so that ruled that problem out.
Anyway, initially no luck until I joined the ground pins together, then a lovely blinking light appeared at the end of the tunnel. Result! If I can transfer this success to the Pi then I’ll be well chuffed. However I’m not sure a two-way serial cable will work through my level converter board, which uses a couple of resistors for one direction and a transistor going the other. I’ll keep at it.
Another new toy arrived in the post. This time a kind friend sent me this Texas Instrument micro controller dev kit. How kind.
Package arrived yesterday. All the way from Australia. Well, China actually, but it’s content was purchased from an Australian’s Kickstart project. Let me introduce you to my shiny new PCnDuino. It’s a PIC micro controller on one side and an Arduino Nano clone on the other. All this for about AU$20.
It’s pretty groovy. Both micro controllers run in parallel, though only one connects to the USB at a time. But I guess you can link the, together and share comms. Not sure what I’ll use it for yet but it’s a very handy self education tool.
I managed to wangle a free ticket to a talk given by the Raspberry Pi Foundation at Broadcom’s Cambridge Science Park office. Though this is but 100yards from my own place of work I had to bike in from home as I was on a day off.
I’d rather hoped to do the entire iPad thing and live Tweeted the even whilst blogging, but it didn’t quite work out that way. There were interesting presentations given by Lang, Bishop, Upton and Gert van Loo., and a lot of enthusiastic energy in the room.
Talking to some people there I’d have said though most were from Wireless technology companies, they were there due to personal [domestic] interest. That said three firms have short presentations on quite commercial applications using Raspberry Pi. I wasn’t convinced they really needed a Pi for their tasks but it did provide an adequately cheap capable platform.
I wanted a minute to chat to Gert van Loo at the end concerning his interface board but he was with someone one moment and swamped so much later on that even standing on a chair I couldn’t see the hardware. Ho hum.
Came home much encouraged by my own level of knowledge. Time to start building something.
Well I found out why the Pi was having trouble bit-banging at 4200 baud. It seems it just can’t do it due to Linux multitasking. I thought he libraries would have that fixed but it seems not. This leaves only the hardware supported channels: UART, I2C and SPI. These at least should buffer some data and send it even if the processor is busy.
So after a bit of hacking I have two-way IO between the Pi and Arduino over the UART. I’ll try the SPI AND I2C another day but this means I can control the Arduino from the Pi and let the Arduino control peripheral hardware. Not ideal but further forward than before.
Next I’ll try using the Arduino UART to control my OLED display. This requires some detective work with a borrowed digital storage oscilloscope. I’m not sure what I’m doing wrong. It may not be possible. Alternatively I might turn to programming a Pic 18m and using that instead. That should work at 3.3v too.
So, finally all the comms are coming together so I better get planning on my first proper project.
Well I came home from work early today due to the snow and worked via VPN. Meanwhile The Nipper arrived back from school but parked himself in the front garden frolicking like a mad thing in the rapidly thawing snow. Never happier.
I spent the evening trying to get some Arduino software running on the Pi with no joy despite pushing the signal through my mini logic analyser to check it. Very strange. Getting more confident with this stuff though.
I really need a good oscilloscope though. That and lots of time.
Almost forgot to add: tomorrow is the Makerspace open evening. Worth trudging through the slush for.