So, now I hopefully(!) have my cable which will give me access to the UART RX of the CC128 energy monitor. Time to try it out and begin processing some data with it!
Firstly, I go to the XMOS website and get the UART code and play around with it to create the UART code I want (RX only at the moment), compile it and give it a run.
But it’s never that simple! All I get are null characters. Odd I think – so I recheck the wiring, recheck the code. All seems to be ok.
So I strip down the code to a really simple function- one that just receives a character and prints it out (see the Super Simple UART receive function source file)
I still get null characters – maybe I got the wrong pins? Check again… nope, seems fine. So I decide its time to void the warranty (follow these CC128 teardown instructions at your own risk!).
Turns out there is a bit of solder between a via into the ground plane and the UART TX pin on the RJ45 connector (pin 8). After removing this I connected the XC-3 back up to the device and wah lah- it gives me the first character (a ‘<‘) of the XML data string.
Now to get the whole string out – so off I go to re-implement the more complex UART code.
After some battling I got it running!
The output looks like the following is in line with the CC128 XML documentation.
Next time… parse the XML and output to somewhere a little more useful!