Friday, April 25, 2014

Microchip based CAN Interface - Part II

Since I had built my microchip prototype PCB I barely had time to test it, or even write code for it. Over the months I would get friendly reminders from people if I had completed it yet (thanks Justin ;) ) and I had to keep saying no. I finally got some time to work on it (especially after getting some help in the form of a benchtest setup) and started to run into some (now) obvious design failures over the last couple of monhs. I'll be frank and just post them here for all to see:

1) Peripheral Pin Select Blindness - aka Don't speed through the datasheets!
The DSPic33 supports Peripheral Pin Select, which means you can specify on which pins (out of a list) you want your CAN Transceiver (or other peripherals) to work. I had simply blindly picked a couple of pins that looked good 'layout' wise, without reading the details in the datasheet.
Turns out that some of the Peripheral Pins are Output, and Others are Input Only.. Guess what this blind dumb-ass did? Yup, have inputs as output and vice-versa. Now as far I know that's a problem ;_ So I fixed that with some wire jumps for now - and ordered some new PCBs.. because after all - what else could go wrong right? WRONG - OOPS - another issue:

2) Apparent Inappropriate Part Selection.
For the CAN Transceiver portion I always liked the 8 pin Melexis TH8056 as I had used that with the ELM329 as well. I have a bunch of them so why not use them for this build as well? Well - the ELM329 runs on 5 volts and that 5V is connected to the RX Leg of the TH8056. Guess what voltage the DSPic33 Runs off? 3.3v... So the TH8056 does not want to receive anything. While the TH8056 datasheet states the 'logic pins support 3.3v' (like their Mode0/1 pins) they seem to explicitly specify on another page that the voltage on RxD needs to be 5V.. I tried several different scenarios and it indeed does NOT seem to work with 3.3v (If I'm just being an idiot - feel free to post a comment with how to get it to work since I'd love to salvage the boards I already made). So with that problem facing me right now it leads me to:

3) Terrible Customer Service from Melexis.
What further really irritates me is that when I reached out to Melexis for some clarification on their datasheet and basically asked "can the TH8056 work (or be made to work) with 3.3v on that RxD pin instead of 5V" instead of a simple yes/no or have a technical person give a little insight with perhaps a schematic tweak to get it work you get the sales vultures saying they can't help you because you need to first provide your life's story, company, units per year, market information, where your product is being 'manufactured', where is it being sold, etc etc..
Seriously?? I'm just a guy with barely 10 square inches of space in my kitchen to solder some sh!t together for myself, asking for technical information about your chip - don't give me your BS sales drivel, just give me a f*ckin' answer! Digging through old emails I actually noticed I had tried to ask them similar information a couple of years back and got the same BS request for more information before they could answer - when I did respond in detail with what i was working , etc etc on they surprisingly didn't even bother responding since I'm not a million unit+ customer.. 

So a big middle finger to Melexis - they can keep their TH8056s and shove it.. I'm moving to the Freescale MC33897s.. yes they are 14 pin (8 pins got discontinued a long time ago) but at least I know for a fact they work on 3.3v..


So where does that leave me - well looks like I'll be making a new prototype PCB - yet again - but hopefully this will be (one of) the last.

New Blog for Projects

So I've decided that I'm going to post more about my projects (electronics, software etc) here instead of keeping them on my car blog. That way everything that relates is all together and it will be easier for me to keep track of things. If there are posts that could fit on either I can always copy & paste it to the other blog as well.

To start with I've copied over all of the electronics / GMLan / CAN Bus posts etc here already - I have kept the same dates as the original postings to keep historical perspective.

Thursday, October 31, 2013

IQ Radio Custom Startup Animation

So after my previous posts where I can now do Custom boot logos on the Pontiac G8 / Holden VE Radio and made some programmers for a few select friends so they can do the same, it was time to move back to the bigger & better IQ Radio. While I had the basics down of the 'wallpaper', the boot anim was still not supported.

I had some downtime and with some friendly prodding from some Australian people (hey Jezzab ! ;) ) I figured I better get off my ass and do something about it. I won't go into technical details, but basically I had been able to extract the boot logo animation frames, but I not been able to successfully inject a new animation back in. After a few test runs where Jezzab was gracious enough to try reflashing his IQ unit in his car and ending up with a non-functioning radio, I finally reversed the missing piece of information and was able to deliver not only a proof of concept, but actually finished a nice clean software tool to do the job for me (well.. for whoever would be selling these things)..

Here's the POC logo anim I made for Jezzab's Business.. Nothing fancy, but it shows it works!
Now I just need to get working on full-blown theming and you'll be able to have a completely custom UI in your IQ Radio!


Saturday, July 27, 2013

Microchip based CAN Interface - Part I

So after tinkering a lot with the ELM329 I started to actually get somewhat irritated with the limitations. While it works great for some basic scanning and sending basic commands BY HAND, when you start dealing with more intricate messages such as large multi-line messages etc or wanting to use it programmatically, it becomes a problem. Also the text base of everything seemed rather inefficient especially when dealing with it in code: i.e. you'd have Hex on the bus, converted to string by the elm, then convert that back to hex in your program, do something, convert whatever you want to send from hex to string, send to elm, that converts is back to hex before putting it on the can bus. Talk about a lot of extra steps for no reason.

I had already been playing with a LPC-based ARM Cortext dev board, and I figured I could make something like that but in a neat tiny box etc. However I wanted to give the microchip platform a try instead of the ARM, I wanted something with at least Dual CAN Capability. Oh and let's not forget the lowest pin-count possible, because I really don't want to mess with a 144 pin device.  Then of course add some kind of USB Interface -I could go with a CP2102 like I've used on the ELM329 simply connected to the UART pins, but for the price difference I noticed I might as well go for a model that has USB built in. That way I can actually use it as HID device instead of being forced into an archaic Serial Port type setup, and I have to worry about less parts on the board.
This led me to the dsPIC33E Series of chip.

Having learned from my Elm329 baking adventures that 2 sides pcbs are a bit of a pain in the ass(not that much, but still so much easier to do it one sided), I figured i'd make a single sided pcb that would fit in a Hammond 1551 box...

Took me forever to make a layout I was happy with and get the routing just right (I like to torture myself and hand-route everything , though since this chip supports dynamic pin reassignments it makes it a bit neater) but it looks pretty sharp! I took some extra time to make a nice logo on the back and besides just using the silkscreen layer I'm actually using the (lack of) Soldermask layer to add some cool touches to the design. Now i'm just hoping it works the way I think it does..

Initial Design
Component Side

Bottom Side with awesome logo!

And all populated - by hand this time since I didn't make a stencil yet

Saturday, June 15, 2013

Serial Port 'ThingAmaJig'

So to do some 'handy work' on some of these radios and clusters some people over at carmodders hacked together a solution on a breadboard. I figured it would be nice to clean it up a bit and make it more user friendly. I'm not going to post the details but I'll post pictures of the design and the finished product. I'm quite pleased how this turned out with the silkscreened logo on the back.

I went through a couple of rough drafts before I had a small design I was happy with. As to why I didn't fully extend the board under the serial port: I had some size constraints (I had to be under 'x' amount of square inches) so anything helped :) Aesthetically I would've preferred the PCB to extend the full length under the DB9 connector.


And here are the circuit boards as they came in from OshPark



Couple minutes of soldering and it's done
 
A whole bunch completed for all the guys over at Carmodder

Sunday, June 9, 2013

Radio Logos - Part IV

So after playing with these Radio logos for a while I figured I'd see if I could get a more detailed animation in there. Most the stock logos are fairly simple: A static logo that fades to black. In my last post about this the new ones I made were done in a similar way, but with a little bit fancier fades.

This time I figured I'd try to make a few more intricate ones that would be 'full screen'  animations. Obviously trying to cram this in the same amount of space would be a challenge, especially with the limitations on the number of frames, colors, resolution, memory etc, but I managed to work around that. Even then it was a tight squeeze requiring quite a bit of manipulation to get it to fit.

So here's some more samples of what can be done.


Thursday, May 2, 2013

Radio Logos - Part III (Custom G8/Holden Radio Logos)

After some fun with the new IQ Radio I figured it was time to get back to those decoded Series 1 Radio images I had been sitting on for way too long. With some more digging and experimenting we (the lovely people on CarModder) figured out yet another way to get custom boot images on the radio, which for testing purposes worked out nicely.


So what does that let us do: Totally Custom Radio Boot Logos! That's right - you can have a completely custom animation play when your radio powers up / down. It doesn't even need to be a simple fade, but can be something fancier.

Now to clarify: this is NOT what other places are selling when they let you pick supposedly 'custom' logos. These radios are shared amongst different Holden Cars, Vauxhall, and of course Chevy and Pontiac. So stock from the factory these radios come with 6 logos already pre-programmed as shown here. They let you pick one of those 6 images- Sorry, but changing 1 factory setting for another factory setting is hardly what I call 'custom' (or let alone 'hacking the radio'...*insert big eye roll here*). I can do the same change (including the blue text etc) with my basic ELM329 cable...

No, what we can now do is put ANY suitable image/animation on there! If you wanted Spongebob popping up on your screen, you can. If you wanted a picture of your family, you can. If you want a screen that shows some photos of your car, you can. Some Custom pontiac / G8 Logo? you can. Unicorns, flying cats shooting laserbeams? Doable etc etc. If you can think it - it's possible! (keeping in mind animation length/size constraints).


Here are some basic samples:




In-car reprogramming has also been proven possible, so this will allow us to do all this over the OBD port instead of having to take out the radio.

Good stuff!