E/X-Mag Microcontroller Programming (Atmel AT90S2313)
I am a student at UW-Milwaukee and have chosen to do an Independent Study for my final semester to write my own software for my X-Mag. One of the bigest problems was finding the connectors and making the wire harness to connect the Programmer to the Gun. I was finally able to do that and spent quite a bit of time and money but after that it's all in the code... I actually purchased the crimping tool necessary to make the cables, so if anyone else is interested in trying to program their own gun send me a Private Message or an email and we can discuss getting you setup with the hardware. (I'll tell you what to buy, you have it shipped to Me and i'll make the wire harness for you, test it and then ship it to you.)
I am opening this thread for anyone who wishes to discuss any programming problems or ideas. I had been just sending Private messages to Miscue and several others but it was pointed out to me that i should open a thread since other people might have the same questions. Hopefully this thread can follow my progress and act as a beginners guide for anyone who wishes to write their own software.
To start there are several documents you'll need
1. Atmel At90S2313 User Guide
2. Atmel Instruction Set
3. Agilent HCMS-2912 Data Sheet (Alphanumeric Display)
4. Agilent HCMS-29xx/HCMS-39xx LED Displays Character Set
Once you have browsed through the documents and have the ability to flash in your own code you will have to start writing it. to start Look at the example files that come with AVR Studio, particularily tutor1.asm and avr108.asm which should be in the appnotes folder under the install directory. Once you assimilate this concentrate on the I/O Ports Section of the AT90S2313 User Guid (page 50) You'll need to know what devices are connected to which ports.
Here is a list of what i found when doing a pinnout of the Board. If anyone wants a full pinnout of the Microcontroller or a reverse engineered schematic on the board let me know and i'll either email it to you or post it if i get enough requests.
Port B
PB7 - N/C
PB6 - ACE
PB5 - Tournament Lock
PB4 - Display RS
PB3 - Display DATA IN
PB2 - Display CLOCK
PB1 - Low Voltage
PB0 - N/C
Port D
PD7 - N/C
PD6 - Display CE
PD5 - Bottom Button
PD4 - Top Button
PD3 - Solenoid/Warp Feed (at the same time)
PD2 - Trigger (HES)
PD1 - N/C
PD0 - N/C
Can someone double check these? I haven't gotten far enough in the code to use all of them yet and it would be extreemly frustrating if i had this part wrong. Send Me a PM and i'll edit my post so as not to confuse anyone who reads this later.
Still having ACE problems
Miscue,
Thanks for the timer help, and I like your bucket analogy that's a good way to explain it.
can you help me a bit more with the ACE?
I had tried this a few days ago but it didn't seem to work:
sbis PINB, ACE ; See if ACE is ready (ACE=6)
rjmp ACE_Ready ; If ace is ready do the code
I noticed at the bottom of the timer code you had this exact same thing but you jumped to resetACE. How exactly does that work do i have to continuously be resetting the line to a low and a high means that it saw something since the last time i reset it?
I figured there must be a little more to it then just what I had because if it was just a matter of sensing a ball or not sensing a ball how could the difference be between ACE-1 and ACE-2. Could you please elaborate on that too? thanks.