View unanswered posts | View active topics It is currently Wed Oct 18, 2017 12:13 pm



Reply to topic  [ 9 posts ] 
Introductory Articles 
Author Message
LQFP144 - On Top Of The Game
User avatar

Joined: Mon Mar 31, 2008 12:47 am
Posts: 568
Location: New Zealand, land of the long white burnout
Can people post any links of good introductary articles about the cpu (or these style cpu's in general) and hardware and its capabilities. E.g. if I have never worked this intimately with microprocessors before, what should I read to get me up to speed?

Thanks in advance,
Aaron

_________________
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82


Tue Apr 01, 2008 8:02 am
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14822
Location: Home sweet home!
My current advice for lack of time to assemble some good knowledge is to do a grep of the source directory for http

cd src
grep -rn http .

and you will have plenty of good reading to do :-) If you give it a context of a few lines each side you should see what you are reading about too.

There are tonnes of good links for the hcs12(x)

http://www.s12x.com/

should probably link to some of them

I hope that helps :-)

Admin

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Tue Apr 01, 2008 10:31 am
Profile WWW
LQFP144 - On Top Of The Game
User avatar

Joined: Mon Mar 31, 2008 12:47 am
Posts: 568
Location: New Zealand, land of the long white burnout
Admin wrote:
There are tonnes of good links for the hcs12(x)

http://www.s12x.com/


Could only really find links to books on there.

Can anyone recommend an introduction to embedded systems book aimed at the programmer?

Thanks in advance.

_________________
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82


Wed Apr 02, 2008 8:52 pm
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14822
Location: Home sweet home!
I'll try and assemble some links for you. It really is very easy to just do basic things. More complex things are only as tricky as the code that makes them up and the semantics of what you are trying to do.

If you grab the 0.0.1 version and up you will see that there is very little required to make the thing do basic stuff.

You literally just write to registers like this :

porta = 0xff; // turn all porta pins on

porta = 0x00; // turn all porta pins off

Additionally you can do it with an OR, XOR, or AND to just toggle particular pins.

Admin.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Wed Apr 02, 2008 9:04 pm
Profile WWW
LQFP144 - On Top Of The Game
User avatar

Joined: Mon Mar 31, 2008 12:47 am
Posts: 568
Location: New Zealand, land of the long white burnout
Are the variable names you mention ( "porta" set up in init_io() ) preset in the compiler or do you need to assign them to the part of the hardware they control somehow?

From the code I gather they are preset?

_________________
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82


Thu Apr 03, 2008 12:36 am
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14822
Location: Home sweet home!
From the processor header, 9s12xdp512.h :

Code:
/* shortcuts to speed formatting */
/* www.atmel.com/dyn/resources/prod_documents/avr_3_04.pdf First page, second column */
/* http://www.ee.nmt.edu/~rison/ee308_spr06/homepage.html */
/* extra parentheses for clarity and guarantee of precedence */

/* Dereferenced Volatile Unsigned Char Pointer */
#define DVUCP(address) (*((volatile unsigned char*)(address)))


and for example :

Code:
/* Port Integration Module - Reordered within sections for clarity */
/* PIM information from 5 tables the last of which is spread over three pages */

/* Plain ports output switch, input state registers */
#define PORTS_BA DVUSP(0x0001) /* Both A and B combined as a 16 bit register for ignition access */
#define PORTA DVUCP(0x0000)
#define PORTB DVUCP(0x0001)
#define PORTE DVUCP(0x0008)
#define PORTK DVUCP(0x0032)
/* #define PORTC DVUCP(0x0004) these pins are not bonded on the 112 pin package */
/* #define PORTD DVUCP(0x0005) these pins are not bonded on the 112 pin package */


They are shortcuts to make a pointer to a memory location from a literal memory location. I'm not 100% certain that this is the best way to use the hardware, but my code god has been busy (got himself a girl) and hasn't had time to tear my code apart and tell me how to do it properly.

When you write to say port B, your data gets stored in the memory location at the address in the header.

Does that make sense?

This the same for all the control registers etc. Pretty much anything you "actually do" happens by writing/reading a register like that.

Then it comes down to interrupts which should be fairly straight forward if you know what they are at all, and just general structure and logic and computations.

How was that?

I have to admit something : I SUCK at being a teacher. Typically I fail to see it how the student does and I go right over their head :-)

Hopefully by trying my best to be clear I've done OK.

Admin.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Thu Apr 03, 2008 12:47 am
Profile WWW
LQFP144 - On Top Of The Game
User avatar

Joined: Mon Mar 31, 2008 12:47 am
Posts: 568
Location: New Zealand, land of the long white burnout
Spot on, that was really my only question about the code. (Apart from some of the logic but that is me not understanding engine management completely...)

Now I just have to get up to speed on C's compiling/linking etc and the hardware itself...

_________________
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82


Thu Apr 03, 2008 12:49 am
Profile WWW
LQFP144 - On Top Of The Game
User avatar

Joined: Mon Mar 31, 2008 12:47 am
Posts: 568
Location: New Zealand, land of the long white burnout
Should have done a quick search for there definitions... my bad haha

_________________
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82


Thu Apr 03, 2008 12:50 am
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14822
Location: Home sweet home!
sry_not4sale wrote:
Apart from some of the logic but that is me not understanding engine management completely...

If you have any questions, fire away. Most of what is in there is clearly discussed in various threads though. I can link you if your question is about that sort of thing. The interrupt semantics and timer semantics are the main stuff that might be non obvious. Draw a circle on your desk, consider each half of it one revolution of the engine, then think about what the state of the timer etc are when you go past the trigger tooth, and how that relates to the other events etc.

If something isn't clear by the comments and variable names, I need to do better. Point it out.

Admin.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Thu Apr 03, 2008 12:54 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF. ColorizeIt.