HC908LJ12 - make I/O port

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

HC908LJ12 - make I/O port

3,618 次查看
mohammed
Contributor III
Hi All
 
i know i have alot of question but excuse me, i don't know any where else to ask about FreeScale controllers;
i realy appretiate your help,
 
i need to get started with it, iam familier with other controllers, i need some information to link my data about the other controllers to LJ12 controller,
 
1- i need to make Port B as an output port and out 1 to pin 3, mean BSET 3, PTB;;;;;;;
 
2- i need to use the ADC , E2Prom
 
just to start

--
Aban Edit: put part number in subject line, please
 
 


Message Edited by Alban on 2007-05-10 02:31 PM
标签 (1)
0 项奖励
回复
7 回复数

1,518 次查看
LeonMa
Contributor I

How download this files:

HIS-DRIVER_HC908SGF50NVM
HC908SGF50NVMSSD
HC908SGF50NMBSSD31

?

0 项奖励
回复

1,763 次查看
Alban
Senior Contributor II
Hello Mohammed,

When using CodeWarrior, you could use Processor Expert to create all the initialization and code for you.
If you don't want to fully use Processor Expert, you can copy just the portion of code you want in another project.

It is the fastest way for you to get to what you want.
The other way would be to use examples, but it means you need to fully understand to modify the example to suit your application.
The third way (the best) is to read the datasheet and act accordingly. It is long but the only way to know exactly what you are doing.

Note that you also having free trainings available at http://www.freescale.com/support in the Explore column.
These training explains the module and will allow you to understand how to proceed.

Regards,
Alban.
0 项奖励
回复

1,763 次查看
mohammed
Contributor III
Dear Alban
 
thank you for your gaudiness,
but the problem
1- the first solution it gives me link error,  {{Vector allocated at absolute address 0xfff0 overlaps with sections placed in segment .absseg0
 
2-am already trying to use examples, but am not expert yet in the CW and HC08 controllers, so any simple problem takes time, and also there is a leak in the numbers of the examples, you can find just three or four on the other hand PIC or Atmel have thousand of examples,
if you can guide me to find a lot of samples code that will very nice of you
 
3- Data Sheet, here is the main problem, the data sheet is very specific, and it doesn't tell everything,especialy the link between CW and the controller, i found shortage in the configuration of the ports, and LCD driver and E2PROM,
and when i do something written in the data sheet CW gives me errors like E2PROM issue -i put in another message still not solved yet-
 
thank you for your time,
 
BTW my first name is Hasan,
0 项奖励
回复

1,763 次查看
Alban
Senior Contributor II
Hello Hasan,

You can get rid of problem n° 1 by creating a project from nothing using Project Wizard.
The Project Wizard, and also Processor Expert (PE) allow you to create a working basis with all the MCU initialized.
I don't use PE because it's too high level for me and I deeply know the MCU, but I think it works like C++ where the beans can call functions (like methods) depending on events.

For n°2, most of the example are in Application Notes and Engineering Bulletins. It's true that software is not available like this.
Usually these documents will explain the subject and then illustrate it with a piece of code.
The code is either included at the end of the PDF document or available as a separate package named after the application note, for instance AN1234SW.zip.
I advise you to go to www.freescale.com and use the search engine on the top right (the forum top right search engine will be working next month, it is not now). If you put keywords linked to your application, you will find related document and you can select product families to limit to pertinent ones.
For instance search for "Application Note SPI *HC08*"
Or you can start from the LJ12 product page.

On n°3, I understand your frustration, the datasheet is more like a contractual document describing the abilities rather than a User Guide as such.
This was chosen this way because some modules would need a 100 pages to be fully explained. As it is just know some S12X devices have already more than 1000 pages. Therefore Application Notes and Engineering Bulletin describe how to use it best.
For the E²PROM and Flash, you can get (NVM) Non Volatile Memory drivers for all products.
On the HC08 you can use the following:


Device Drivers
ID and DescriptionVendor IDFormatSize KRev #Availability
HC908SGF50NMBSSD31
Standard Software Driver (SSD) for HC908 0.5um SGF NVM release v3.0.1
Program/erase software driver for 0.5um SGF NVM (flash and EEPROM) in HC908.  
FREESCALE  zip  1595  3.0.1  
HC908SGF50NVMSSD
HC908 SGF NVM Standard Software Drivers
Program/erase software driver for 0.5um SGF NVM (flash and EEPROM) in HC908  
FREESCALE  zip  1394  3.0.0  
HIS-DRIVER_HC908SGF50NVM
HIS-compatible Driver for 0.50um SGF Flash in HC908
 
FREESCALE  zip  2333  1.3  



Regards,
Alban.
0 项奖励
回复

1,763 次查看
mohammed
Contributor III
Hi Alban,
 
thanksssssss, for the information,
 
i don't know what to do, i tried your first solution, but iam still beginner so i tried to initialize the controller, but am still can't control the PORT B,,,,, i have a Cyclon pro and a HW with a led connected to pin 3 of the micro, i need to control it, but i don't know how,,,,,
 
another inquery i watch the Memory window in the simulation, PTB is number 0001, and when i write anything to it nothing changes at all,
 
about E2PROM, first thing i don't know how to use this driver, ot what is these drivers,
second thing when i set these programs it gives me errors   ( the parameter is not correct)
 
please advice
 
0 项奖励
回复

1,763 次查看
Alban
Senior Contributor II
Hello,

How to connect the programmer to the HC08 is described in the HC08 datasheet.
There is a also a schematics showing the pin-out of MCU pins to be put on the HE16 header for the Cyclone pro. This is the MON08 16-pin connector.

To edit a location, you need to click, and then click again to enter in edit mode. Type the data and then press enter. The modified data displays in red usually.
Changing PTB without changing DDRB would not change the status of the pin, only the status of the register.

I am afraid that you will need to read the manual for this one, as I can only repeat the same thing.
If you do not want to go into complicated details with these drivers, it could be simpler to re-write Erase and Program functions yourself. The datasheet of the HC08 explains each step in the flash chapter.
Furthermore there are a few applications on HC08 In-Ciruit Flash Programming.

HC08s are relatively easy to use microcontroller. However, I think you need to read the device datasheet to see what it is capable of doing and how you can achieve it.
Also taking the trainings is an idea to familiarize yourself with the family.

Explaining instruction by instruction is not a viable option as it will take months to go through them all.

Regards,
Alban.

0 项奖励
回复

1,763 次查看
mohammed
Contributor III
Dear Alban;
 
thank you,
did you mean by
{{{To edit a location, you need to click, and then click again to enter in edit mode. Type the data and then press enter. The modified data displays in red usually}}}
the initialize Device,,,,,,,,
 
port B is working fine now, i write to  DDRB then to the port;
       MOV #$08, DDRB
       BSET 3,PTB
also if you know BigMac, he edit my code related to E2PROM but i still having an issue ,
 how to fill the dataarray, where it begins???
as i wrote, in PIC i know data and an address to write at,,,,,so i write the data at the address,
in Freescale i think the dataarray is the data,,,,and the address is the FLASH_START,,,
 
but how to fill the data array and how to verify i wrote to that address in the flash successfully
 
 
0 项奖励
回复