Friday, 3 May 2013

PIC Datalogging With Added Raspberry Pi


Here we have a PIC 18F4620 in data logging mode collecting analogue values from 8 ports and outputting them serially via the USB bridge.  The software formats the 8 10-bit analogue values into a 'frame' like this -

{HLHLHLHLHLHLHLHL}[CRLF]

and these are sent every 1/10 of a second at a baud rate of 115,200.  The H is the top 5 bits (most significant) of the analogue value and the L is the bottom 5 bits (least significant).  To add clarity when testing, I added 40h (64) to these values to make them printable characters instead of control ones so the data frames can be viewed in the Putty terminal program.


This is Putty running on the Raspberry Pi receiving the data frames from the PIC.  The text 'SERIAL READY' is sent after a reset and is also a useful test.

What next?  Wait and see, but the clues are Apache, PHP5, Android and access point.

Need a cup of coffe now.  And some heat, for May it is freezing here in Northern Ireland and my wife's brother is getting married tomorrow so I hope it brightens up.

No comments:

Post a Comment