I would be guided by Wikipedia in this case :
"... By convention, 12 AM denotes midnight and 12 PM denotes noon ..."
"... 12 a.m. means noon and 12 p.m. means midnight ..."
A little late to this particular party, I know, but here is my five cents' worth.
I have encountered just as many people who insist it is the other way around. I do not think it is possible to define a settled convention. Even if it were, as has already been observed, the "m" in both "a.m." AND "p.m." is "meridiem" which, translated into English, means midday.
It necessarily follows that 12 a.m. is midnight (12 hours before midday) ... and 12 p.m. is ALSO midnight (12 hours after midday).
There was, in fact, a very sensible convention in the 19th century that 12 noon was "12 m." ... and this abbreviation is obviously correct once the Latin expansion of the two commonly used abbreviations is understood.
It is a shame, therefore, that this convention has fallen out of use; but given that it has, then if you wish to avoid ambiguity, "12 noon" and "12 midnight" are clearly to be preferred as they are both (a) incapable of being misunderstood; and (b) not dependent upon an external reference source such as Wiki to justify their use.