Dioda - un site pentru marii pasionati de electronica  
Toggle Content .:: Home :: Downloads :: Community Forums :: Register ::.
Toggle Content Meniu Principal
 HOME
 Home
 Search Web Continut Community
 Forum
 Members options
 News
 Surveys

Toggle Content Produs Random
0
PICOSCOPE 2105 - OSCILLOSCOPE, PEN TYPE
1.033,61Lei(-14 %)
888,90Lei

Toggle Content Mesaje Forum

Toggle Content Login

Welcome Anonymous

Nickname
Password

Membership:
Latest: Zoltan
New Today: 0
New Yesterday: 0
Overall: 898

People Online:
Members: 0
Visitors: 5
Total: 5
Who Is Where:
 Visitors:
01: Forum
02: Home
03: Cauta Componenta
04: Forum
05: Forum

Staff Online:

No staff members are online!

Toggle Content Languages
English

Toggle Content Ultimile Imagini

Forum › Microcontrollere › 8051 PIC AVR ARM › hex from asm
hex from asm
Discutii legate de microcontrollere (8051 PIC AVR ARM etc ..)
Post new topic   Reply to topic   Printer Friendly Page    Forum Index 8051 PIC AVR ARM

View previous topic :: View next topic  
Author Message
chiarEl



Joined: Mar 01, 2007
Posts: 5

PostPosted: 01/Mar/2007 3:18 pm    Post subject: hex from asm Reply with quote

...sau ma rog .bas poate cineva crea un hex dupa asta?

Am AVR studio4 dar imi cere nu stiu ce ICE200 pentru a programa un at90S2313.

Iata fisierul:

' *****************************************************************************
' * Title : EEPROM programmer.bas
' * Last Updated : 05.03.2006
' * Target device: At90s2313, 24C32
' * Author : www.avrprojects.net
' * Program code : BASCOM-AVR
' * Hardware req. :
' * Description :
' * This application reads and writes one page at a time to an 24c32 EEPROM connected to an
' * AT2313 microcontroller.
' *****************************************************************************
Dim D_w As Byte , D_r As Byte , Adress As Byte , E_adr As Byte , E_dat As Byte , I As Byte , Count As Byte

Dim Rw As String * 1 , Datastr As String * 32
Dim E_data(16) As Byte

Config Scl = Portb.0 'assign the SCl line to PORTD.0
Config Sda = Portb.1 'assign the SDA line to PORTD.1

'Declare Sub Byteread
'Declare Sub Bytewrite
Declare Sub Pagewrite
Declare Sub Pageread

Main:
Do
Input "(R)ead page / (W)rite page?" , Rw
If Rw = "R" Or Rw = "r" Then Goto Read_eeprom
If Rw = "W" Or Rw = "w" Then Goto Write_eeprom
Loop
End 'end program

Read_eeprom:
Do
Input "Read EEPROM page :" , Adress
Print Adress ; ":" ;
E_adr = Adress * 16
Call Pageread
For I = 1 To 16
Print E_data(i) ; ",";
Next I
Print
Loop

Write_eeprom:
Do
Input "Write EEPROM page :" , Adress
For I = 1 To 16
Input "Input byte ";i;" :" , E_data(i)
Next I
Print Adress ; ":"
For I = 1 To 16
Print E_data(i) ; ",";
Next I

E_adr = Adress * 16
Call Pagewrite

Print

Loop

'********** page write to EEPROM ***************************************************
Sub Pagewrite
I2cstart 'generate start
I2cwbyte &B1010_0000 'send device address
I2cwbyte &H00 'H adress of EEPROM
I2cwbyte &H00 'L adress of EEPROM
For I = 1 To 16
D_w = E_data(i)
I2cwbyte D_w 'data to EEPROM
Next Adress
I2cstop 'stop condition
Waitms 10
End Sub Pagewrite

'********** page read from EEPROM **************************************************
Sub Pageread
I2cstart 'generate start
I2cwbyte &B1010_0000 'send device adsress
I2cwbyte &H00 'H address of EEPROM
I2cwbyte E_adr 'L address of EEPROM
I2cstart 'repeated start
I2cwbyte &B1010_0001 'slave address (read)
For I = 1 To 16
I2crbyte D_r , Ack 'data to EEPROM
E_data(i) = D_r
Next I
I2crbyte D_r , Nack 'read byte from EEPROM
I2cstop
End Sub Pageread 'generate stop


'********** byte write to EEPROM ***************************************************
'Sub Bytewrite
'I2cstart 'generate start
'I2cwbyte &B1010_0000 'send device address
'I2cwbyte 0 'H adress of EEPROM
'I2cwbyte 0 'L adress of EEPROM
'I2cwbyte D_w 'data to EEPROM
'I2cstop 'stop condition
'Waitms 10
'End Sub


'********** byte read from EEPROM **************************************************
'Sub Byteread
'I2cstart 'generate start
'I2cwbyte &B1010_0000 'send device adsress
'I2cwbyte &H00 'H address of EEPROM
'I2cwbyte &H00 'L address of EEPROM
'I2cstart 'repeated start
'I2cwbyte &B1010_0001 'slave address (read)
'I2crbyte D_r , Nack 'read byte from EEPROM
' I2cstop 'generate stop
'End Sub Byteread
Back to top
View user's profile
daniel



Joined: Feb 22, 2005
Posts: 130

PostPosted: 02/Mar/2007 3:46 pm    Post subject: Re: hex from asm Reply with quote

Buna,

problema sta in felul urmator :
ai un program scris in limbaj Basic. iti trebuie un compilator de libaj Basic si in cazul acesta este vorba despre BASCOM-AVR. Acesta va compila codul tau si genereaza (in general ) un cod in asamblare .ASM. Acest asm este compilat de un Asamblor si genereaza cod executabil de catre microcontroller. Acesta poate fi .BIN (fisier binar) sau .HEX (format intel hex cu cifre de control).

Apropo : ce aplicatie vrei sa faci ?
Vezi ca mai nou microcontrollerul AT90S2313 a fost inlocuit de ATTiny2313 care are oscilator intern, este pin compatibil si are si memorie flash interna.

Daniel
Back to top
View user's profile Visit poster's website Photo Gallery
chiarEl



Joined: Mar 01, 2007
Posts: 5

PostPosted: 02/Mar/2007 5:32 pm    Post subject: Re: hex from asm Reply with quote

Multumesc!
am downloadat bascom avr varianta light si am facut hexul

Problema 2 este unde gasesc atmeluri tinny sau s90 pentru a experimenta?
Back to top
View user's profile
daniel



Joined: Feb 22, 2005
Posts: 130

PostPosted: 02/Mar/2007 8:26 pm    Post subject: Re: hex from asm Reply with quote

uuu ...
ce intrebare "rea". Site-ul asta este renumit caci gazduieste o pagina in care poti sa cauti in toate magazinele virtuale !.

Da click te rog pe http://www.dioda.ro/Cauta_Componenta.html

Scrie acolo la cautare "attiny2313" , bifeaza primele 5-6 checkbox-uri si ai sa vezi ce si de unde-ti convine.

Daniel
Back to top
View user's profile Visit poster's website Photo Gallery
chiarEl



Joined: Mar 01, 2007
Posts: 5

PostPosted: 02/Mar/2007 10:25 pm    Post subject: Re: hex from asm Reply with quote

daniel wrote:
uuu ...
ce intrebare "rea". Site-ul asta este renumit caci gazduieste o pagina in care poti sa cauti in toate magazinele virtuale !.

Da click te rog pe http://www.dioda.ro/Cauta_Componenta.html

Scrie acolo la cautare "attiny2313" , bifeaza primele 5-6 checkbox-uri si ai sa vezi ce si de unde-ti convine.

Daniel

www.virtual-electronic.ro Data 02-03-2007


FACTURA

Nr. buc. Produs Pret/buc Pret total

1 SOCL PLCC 32 PIN 20.000 Lei 20.000 Lei
2 Folie de transfer Press and Peel 13 Lei 26 Lei
2 AT90S2313 150.000 Lei 300.000 Lei
1 CUTII COMPART 75.000 Lei 75.000 Lei
1 LED ROSU PATRAT 705X705MM 50 MA 20.000 Lei 20.000 Lei
1 PLACA TEST 15X18 70.000 Lei 70.000 Lei
1 QUARTZ 20 MHZ 20.000 Lei 20.000 Lei
1 QUARTZ 12 MHZ US 18.000 Lei 18.000 Lei
1 QUARTZ 10 MHZ 17.000 Lei 17.000 Lei
1 DB 25 T (90 GRADE) 12.200 Lei 12.200 Lei
1 DB 25 M (90 GRADE) 12.200 Lei 12.200 Lei
1 DB 9 T (90 GRADE) 8.500 Lei 8.500 Lei
1 CAPETE STATII CU AER CALD 100.000 Lei 100.000 Lei
1 SOCL PLCC 52 PIN 27.000 Lei 27.000 Lei
1 Flux AMTECH 145.000 Lei 145.000 Lei
cam asta am comandat.
Back to top
View user's profile
chiarEl



Joined: Mar 01, 2007
Posts: 5

PostPosted: 02/Mar/2007 10:29 pm    Post subject: Re: hex from asm Reply with quote

cum fac sa programez pagini multiple in eeprom?
Back to top
View user's profile
daniel



Joined: Feb 22, 2005
Posts: 130

PostPosted: 03/Mar/2007 2:02 pm    Post subject: Re: hex from asm Reply with quote

ce inseamna pentru tine pagini multiple ? Si mai ales ce aplicatie vrei sa faci ?
Back to top
View user's profile Visit poster's website Photo Gallery
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page    Forum Index 8051 PIC AVR ARM
Page 1 of 1
All times are GMT + 2 Hours



Jump to:  


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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Site-ul Dioda.ro este propietatea societatii Artirom PRO SRL - Cod Fiscal RO14235481 - Str. Bucegi Nr. 45 Sect 1 Bucuresti


You can syndicate our news using the file news.php or news2.php
Interactive software released under GNU GPL, Code Credits, Privacy Policy