| Author |
Message |
|
|
Posted: Jan 29, 2012 - 03:45 AM |
|


Joined: Apr 20, 2007
Posts: 6072
Location: Long Island New York
|
|
@MBedder....
I LOVE spam....It tastes great on a saltine.
I had a feeling the post was not on the up and up, but since Cliff lashed out at everyone about being jerks at noob posts I decided to give the benefit of the doubt...just not too seriously...THat's why I put the following in a quote
Quote:
Quote:
You most definitely have made this post into something special.
Hey guys, we need to frame this on the home page!
At least my P.S was ot bullcrap.
Oh well, mother was right...cannot please anyone these days
Jim |
_________________ Jim
I have decided that I am no longer going to plan anything in advance. In a court of law this is called Pre-Meditated, and does not look good for the defense.....
Timer function not working properly? Check CLKDIV8 Fuse first
|
| |
|
|
|
|
|
Posted: Jan 29, 2012 - 12:41 PM |
|


Joined: Jul 18, 2005
Posts: 62354
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
It's spam - I imagine it was supposed to be signature spam but the bozo forgot to turn it on.
(actually it could be cleverer than that - he has no current signature assigned, so he posts a few of these seemingly innocuous posts then later comes back and sets a URL into the signature in his profile) |
_________________
|
| |
|
|
|
|
|
Posted: Jan 29, 2012 - 08:55 PM |
|


Joined: Apr 20, 2007
Posts: 6072
Location: Long Island New York
|
|
Ok then, back to the topic....sort of
I put this into my equates section:
Code:
.equ rst ="R"
The intent is that when the m48 sees the ascii number for the letter R come in on the uart it knows what to do. I personally don't want to have to keep looking up ascii codes
Thought this would have worked like the eeprom load but nope. tried a few variations with no luck
jim |
_________________ Jim
I have decided that I am no longer going to plan anything in advance. In a court of law this is called Pre-Meditated, and does not look good for the defense.....
Timer function not working properly? Check CLKDIV8 Fuse first
|
| |
|
|
|
|
|
Posted: Jan 29, 2012 - 09:05 PM |
|


Joined: Jul 18, 2005
Posts: 62354
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
| 'R' not "R" surely? |
_________________
|
| |
|
|
|
|
|
Posted: Jan 29, 2012 - 09:24 PM |
|


Joined: Apr 20, 2007
Posts: 6072
Location: Long Island New York
|
|
Yes I did write "R" as I was going off the .db"JGMDESIGNS" convention earlier discussed. Figured the "" would denote ascii not ''
Jim |
_________________ Jim
I have decided that I am no longer going to plan anything in advance. In a court of law this is called Pre-Meditated, and does not look good for the defense.....
Timer function not working properly? Check CLKDIV8 Fuse first
|
| |
|
|
|
|
|
Posted: Jan 29, 2012 - 09:57 PM |
|


Joined: Mar 28, 2001
Posts: 20390
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)
|
|
Single character=single '
More than 1 character or string = double "
..as Cliff pointed out. |
_________________ John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
|
| |
|
|
|
|
|
Posted: Jan 29, 2012 - 10:24 PM |
|


Joined: Apr 20, 2007
Posts: 6072
Location: Long Island New York
|
|
|
Quote:
..as Cliff pointed out.
Did not quite see Cliffs point intill you "POINTED" it out
Jim |
_________________ Jim
I have decided that I am no longer going to plan anything in advance. In a court of law this is called Pre-Meditated, and does not look good for the defense.....
Timer function not working properly? Check CLKDIV8 Fuse first
|
| |
|
|
|
|
|
Posted: Jan 30, 2012 - 10:06 PM |
|


Joined: Apr 20, 2007
Posts: 6072
Location: Long Island New York
|
|
Well things are getting to the end. I cpoied the write and read routines out of the datasheet to load the eeprom, and then tou read it back and output it to the terminal program, but no good:
Code:
Write_eeprom:
ldi ZH,high(wait*2) ;Inform operator to wait for eeprom write
ldi ZL,low(wait*2)
rcall messsend
;write 10digit unique ID to eeprom
ldi XH,0x00 ;load eeprom pointer with eserial location
ldi XL,(eserial)
ldi YH,high(dserial) ;load sram pointer with dserial location
ldi YL,LOW(dserial)
EEPROM_write:
ld temp,Y+
; Wait for completion of previous write
sbic EECR,EEPE
rjmp EEPROM_write
; Set up address (xreg) in address register
sts EEARL, XL
; Write data (r16) to Data Register
sts EEDR,temp
; Write logical one to EEMPE
sbi EECR,EEMPE
; Start eeprom write by setting EEPE
sbi EECR,EEPE
cpi YL,0x0d ;last byte
breq ewrtdone
inc XL
rjmp EEPROM_write
ewrtdone:
ldi ZH,high(cmpltwr*2) ;Inform operator eeprom Write complete
ldi ZL,low(cmpltwr*2)
rcall messsend
;readback eeprom
ldi XL,(eserial)
EEPROM_read:
; Wait for completion of previous write
sbic EECR,EEPE
rjmp EEPROM_read
; Set up address (xreg) in address register
sts EEARL, XL
; Start eeprom read by writing EERE
sbi EECR,EERE
; Read data from Data Register
in temp,EEDR
rcall bytesend
cpi XL,0x0d
breq end
inc XL
rjmp eeprom_read
end: rjmp end
The terminal behaves like the avr is programming, bt when I ask it to read back no go. Tried to connect up the dragon to have a look inside but with the m48 in the stk500 it won't connect(yes I removed the reset jumper)
I am more interested in the eeprom than the dragon.
Any ideas?
Jim
Edit: I used "STS" aas opposed to "OUT" like in the example because the assembler spit up with an error. I have seen this before so I use STS instead. Works though |
_________________ Jim
I have decided that I am no longer going to plan anything in advance. In a court of law this is called Pre-Meditated, and does not look good for the defense.....
Timer function not working properly? Check CLKDIV8 Fuse first
|
| |
|
|
|
|
|
Posted: Jan 30, 2012 - 10:21 PM |
|


Joined: Mar 28, 2001
Posts: 20390
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)
|
|
|
Code:
EEPROM_write:
ld temp,Y+
; Wait for completion of previous write
sbic EECR,EEPE
rjmp EEPROM_write
In the time one EEPROM byte is written (a few ms), Y will be pointing to outer space.
Maybe this will fix it, there maybe other stuff I can't see.
Code:
EEPROM_write:
ld temp,Y+
; Wait for completion of previous write
EEPROM_write_loop:
sbic EECR,EEPE
rjmp EEPROM_write_loop
edit
Quote:
I used "STS" aas opposed to "OUT"
Start using the AVR001 macros, it will select the correct instructions for you. |
_________________ John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
Last edited by js on Jan 30, 2012 - 10:29 PM; edited 1 time in total
|
| |
|
|
|
|
|
Posted: Jan 30, 2012 - 10:28 PM |
|


Joined: Apr 20, 2007
Posts: 6072
Location: Long Island New York
|
|
OHHHHHHHHHHHHHHHH FU#$%
This is what happens when you stare at this crap too long!
Thanks King Samperi
Jim |
_________________ Jim
I have decided that I am no longer going to plan anything in advance. In a court of law this is called Pre-Meditated, and does not look good for the defense.....
Timer function not working properly? Check CLKDIV8 Fuse first
|
| |
|
|
|
|
|
Posted: Jan 30, 2012 - 10:32 PM |
|


Joined: Apr 20, 2007
Posts: 6072
Location: Long Island New York
|
|
Well, that was fixed, but when I read back I get <0>
gonna look for another mistake if anyone sees one I would appreciate a kick
Jim |
_________________ Jim
I have decided that I am no longer going to plan anything in advance. In a court of law this is called Pre-Meditated, and does not look good for the defense.....
Timer function not working properly? Check CLKDIV8 Fuse first
|
| |
|
|
|
|
|