#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
I have a rather strong distrust of debuggers myself based on a number of unpleasant experiences over the years so if I was backing anything here it would be that the debugger is lying about the 0x04 !
Or reads and clears the hardware register, making it 0 for the program when the if clause is evaluated.
With stm32 mcu's/debugger that can actually happen, and yes I have debugged for a "proplem" for day or two when it was just the debugger itself being the only proplem.
This is just a long shot, since i did notice anything about if you have tried running the program without debugging.
I would like to know what hardware is being used i.e. dongle, RS232 cable, ...
and what Serial Terminal software is being used.
RS232 port on back of my Desktop PC. Direct cable to the Serial port of the STK600 and then to the XMEGA
Terminal software is Termite, It sits quietly doing nothing until either it receves data, which it then displays, or it sends data if one types on the keyboard
JIm
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
My wild guess is that you have 2 competing functions for the UDR, getchar AND the ISR.
As soon as the RX flag is set (getchar would be waiting for this) the ISR fires, gets the data from the UDR, clears the flag and getchar never sees the RX flag.
The PC is stopped at the loop of interest but the USARTC0 appears to have interrupts disabled despite the comments in the (generated ?) code indicating that low-level was the intention.
{EDIT}
Oh that's just typical: A Refresh bug in Atmel Studio 7 (Version: 7.0.2397 - )
The I/O registers don't get redrawn after {break} unless you close the fly-out then reopen the fly-out.
That's better.
I cannot be the only one who has been caught with this one.
There is NOTHING else in the code other than that one line.
But there are interrupts running in the background (clearing the RX flag??), that's what putting data into the receive buffer and increasing the rx counter.
Posted by david.prentice: Thu. Mar 12, 2020 - 09:31 PM
1
2
3
4
5
Total votes: 0
jgmdesign wrote:
david.prentice wrote:
I would like to know what hardware is being used i.e. dongle, RS232 cable, ...
and what Serial Terminal software is being used.
RS232 port on back of my Desktop PC. Direct cable to the Serial port of the STK600 and then to the XMEGA
Terminal software is Termite, It sits quietly doing nothing until either it receves data, which it then displays, or it sends data if one types on the keyboard
JIm
That all looks pretty reliable. I don't see where anything can go wrong. After all, people have been handling USARTs with interrupts since day one. And using a similar method to check whether "data is available" in the receive buffer.
In fact CV has provided interrupt-driven Serial comms since CV was first released. Even for a Tiny2313.
I often change "Mega" device in an AS7.0 project. It is not so simple with E5, A1, A4, ... which have some subtle differences.
All the same, you can set up the basics in a CodeWizard file. And generate for E5, A1, A4, ...
I don't have any hardware E5. But the E5 appears to be a cut-down Xmega. 32E5 is the biggest in the family.
If there was a 128E5 it would be worth playing with.
There is NOTHING else in the code other than that one line.
But there are interrupts running in the background (clearing the RX flag??), that's what putting data into the receive buffer and increasing the rx counter.
The counter only increments when i type something into the terminal. I can see if there is a flag set just before the sei, but the puts works and thats after the sei.
Groan. I may email Pavel and take my chances.
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
OK this HAS BEEN fun but it is interfering with piano practice and learn to read music. I have spent on this all the neurons I could afford.
Looking at the disassembly view this is what's happening:
1) The string is printed OK.
2) The code at the non working line keeps on looking for the counter to be above zero, this runs as long as nothing is typed into the terminal.
3) As soon as a char is typed in and the counter goes to 1 then the code seems to be getting the char and printing it??, the RX counter goes back to zero and then, SOMEHOW, the code goes to the endless loop at C5.
4) Any further chars typed in will increment the counter and the data gets stored into the RX buffer by the ISR but nothing else happens as the code is stuck in the endless loop.
and as porky pig would say tha..tha...that's all folks.
Well there you go! You are not just a pretty face.
Thanks for proving my theory wrong too, I can confirm your findings. The counter must get reset to zero every time a new char comes in and gets printed out but the data is still going into the RX circular buffer.
Well there you go! You are not just a pretty face.
Thanks for proving my theory wrong too, I can confirm your findings. The counter must get reset to zero every time a new char comes in and gets printed out but the data is still going into the RX circular buffer.
Yabbut I am still scratching my head as to WHY just having:
while (1)
{
if (DATARECEIVED()) putchar(getchar()); //This does nothing. No output
}
}
Is causing such a fuss. If it were a C issue I would think the compiler would spit up a fuss. Then again......
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
The counter must get reset to zero every time a new char comes in and gets printed out but the data is still going into the RX circular buffer.
Not exactly.
If I wasn't constantly polling the counter, then it would increment by one every time a character came in. Then once I did poll the counter and see that it no longer was zero I would have to run a routine to read out the buffer and clear the counter(through GETCHAR() )
And make sure I poll and readout before the counter resets and the buffer is over written.
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
Probably doesn't do much good without the lst file, as some do not have cv to compile with.
Put the nop as the first thing in the while loop, so every read via lds r30 is preceded by the nop. Doesn't seem like the lds r30 likes the back to back reads when no other memory access takes place between reads (lds r30, cpi r30, rjmp, rjmp). The nop does something, and you would think an interrupt that will take place would also 'correct' the problem (but maybe see below).
You could also try to get the buffer count read to use a pointer so the resulting code is not using lds r30, just to see what a different type of access acts like.
This is the end of the isr (from the jgm listing in the zip file, anyway)-
Maybe the the pointer register usage has something to do with it, as the isr leaves with its last memory access as a pointer type access. In the avr0/1, I saw a strange problem where writing to the sleep control register would not work when using a pointer register to access (compiler generated code used pointers for some reason, then the problem showed up), but either adding a nop or getting the compiler to produce lds/sts (normal), or splitting up the write into two ops 'fixed' the problem. Maybe there are combinations of x/y/z pointer use that create a problem, although if so it must be a rare combo or you would think it would be causing problems all over the place.
I'm not sure what can be done in cv, but if a nop could be inserted before the reti, that could also maybe reveal something useful. Maybe.
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
I was going to offer you the Xplained board I got from Atmel even before the E5 was released.
The situation appears widespread (at least two have recreated?), but is it time to gather the date code/chip rev of the various setups?
In that vein, I was going to peek at errata. Anyone have a hint to find the errata? The datasheet just says "go to microchip.com". And I saw no link in a pass at the product page.
You can put lipstick on a pig, but it is still a pig.
I've never met a pig I didn't like, as long as you have some salt and pepper.
Posted by N.Winterbottom: Sat. Mar 14, 2020 - 10:35 AM
1
2
3
4
5
Total votes: 0
The Xmega32E5 target is a barrier to many (including me).
I had a thought about using the simulator though. Has anyone been successful using the Atmel stimulus file (.stim) to inject characters into the simulator's USART ? (Documentation on .stim files is sparse)
Why? It's just a nice little chip. I have about 3,000 boards in the field with the E5.
I have to agree. It is a nice chip.
Back to topic,
I have a huge non-avr project I need to get on. And I also need to start/finish the one with the XMEGA in so I am going to get back to writing the application and watching the behaviour of things. I will email Pavel at some point and see if he has an explanation as to why things are happening. We shall see what the Big PoohBahh has to say.
Stay tuned Kiddies!
JIm
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
I just fired up the program we have been dissecting and I deleted everything from teh WHIE() loop and hit RUN debugger. The code sits in the while loop and does not go to the WHILE loop in getchar().
Very interesting why either the MACRO, or writing the line of code itself in the while loop causes the problem...
All for now
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Posted by N.Winterbottom: Sun. Mar 15, 2020 - 10:09 AM
1
2
3
4
5
Total votes: 0
N.Winterbottom wrote:
The Xmega32E5 target is a barrier to many (including me).
What I meant by that is, because not many freaks can immediately lay their hands on some real silicon; that it's a barrier to solving the weird problem.
Hence my sub-question about injecting characters into the Atmel Simulator.
Posted by david.prentice: Sun. Mar 15, 2020 - 10:27 AM
1
2
3
4
5
Total votes: 0
My 32E5-XPRO will arrive tomorrow.
It should be fairly simple to see whether the 32E5 silicon behaves differently to 32A4U silicon. Or even mega4809, tiny817, ... silicon.
Or whether Codevision does something different for 32E5.
I am intrigued. The 32E5 has been available for about 5 years. XmegaA1 was released in 2007. The Xmega, mega-0, tiny-0, tiny-1 have been available for several years. There is nothing "new" but of course silicon is revised, compilers are updated, ...
FWIW I've just turned Jim's code into vanilla '328 code and it works as it should. Somewhere I have some 32E5s; I just need to find them.
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopOr reads and clears the hardware register, making it 0 for the program when the if clause is evaluated.
With stm32 mcu's/debugger that can actually happen, and yes I have debugged for a "proplem" for day or two when it was just the debugger itself being the only proplem.
This is just a long shot, since i did notice anything about if you have tried running the program without debugging.
- Log in or register to post comments
TopOh yes - there is that!
Top Tips:
- Log in or register to post comments
TopRS232 port on back of my Desktop PC. Direct cable to the Serial port of the STK600 and then to the XMEGA
Terminal software is Termite, It sits quietly doing nothing until either it receves data, which it then displays, or it sends data if one types on the keyboard
JIm
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user
- Log in or register to post comments
TopMy wild guess is that you have 2 competing functions for the UDR, getchar AND the ISR.
As soon as the RX flag is set (getchar would be waiting for this) the ISR fires, gets the data from the UDR, clears the flag and getchar never sees the RX flag.
John Samperi
Ampertronics Pty. Ltd.
https://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
TopBut john, There is NOTHING else in the code other than that one line.
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user
- Log in or register to post comments
TopSomehow missed the fact that this was an Xmega project and we have a basic prioritised interrupt controller to deal with.
Also struggling to debug this because the ELF contains no debug information:
Anyway using the simulator I get this:
The PC is stopped at the loop of interest but the USARTC0 appears to have interrupts disabled despite the comments in the (generated ?) code indicating that low-level was the intention.
{EDIT}
Oh that's just typical: A Refresh bug in Atmel Studio 7 (Version: 7.0.2397 - )
The I/O registers don't get redrawn after {break} unless you close the fly-out then reopen the fly-out.
That's better.
I cannot be the only one who has been caught with this one.
- Log in or register to post comments
TopBut there are interrupts running in the background (clearing the RX flag??), that's what putting data into the receive buffer and increasing the rx counter.
See my screen shot here https://www.avrfreaks.net/commen...
John Samperi
Ampertronics Pty. Ltd.
https://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
TopThat all looks pretty reliable. I don't see where anything can go wrong. After all, people have been handling USARTs with interrupts since day one. And using a similar method to check whether "data is available" in the receive buffer.
In fact CV has provided interrupt-driven Serial comms since CV was first released. Even for a Tiny2313.
I often change "Mega" device in an AS7.0 project. It is not so simple with E5, A1, A4, ... which have some subtle differences.
All the same, you can set up the basics in a CodeWizard file. And generate for E5, A1, A4, ...
I don't have any hardware E5. But the E5 appears to be a cut-down Xmega. 32E5 is the biggest in the family.
If there was a 128E5 it would be worth playing with.
David.
- Log in or register to post comments
TopThe counter only increments when i type something into the terminal. I can see if there is a flag set just before the sei, but the puts works and thats after the sei.
Groan. I may email Pavel and take my chances.
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user
- Log in or register to post comments
TopCorrect and the interrupts handle that as well as putting the data into the RX buffer.
The program just gets stuck in an endless loop at 0x00C5.
so there is something wrong with the line if (DATARECEIVED()) putchar(getchar()); or the way it is constructed
John Samperi
Ampertronics Pty. Ltd.
https://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
TopSee #11. That loop is the catch loop, for when you run off the end of main(). Now, how does one get there?
You can put lipstick on a pig, but it is still a pig.
I've never met a pig I didn't like, as long as you have some salt and pepper.
- Log in or register to post comments
TopOK this HAS BEEN fun but it is interfering with piano practice and learn to read music.
I have spent on this all the neurons I could afford.
Looking at the disassembly view this is what's happening:
1) The string is printed OK.
2) The code at the non working line keeps on looking for the counter to be above zero, this runs as long as nothing is typed into the terminal.
3) As soon as a char is typed in and the counter goes to 1 then the code seems to be getting the char and printing it??, the RX counter goes back to zero and then, SOMEHOW, the code goes to the endless loop at C5.
4) Any further chars typed in will increment the counter and the data gets stored into the RX buffer by the ISR but nothing else happens as the code is stuck in the endless loop.
and as porky pig would say tha..tha...that's all folks.
John Samperi
Ampertronics Pty. Ltd.
https://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
TopDoesn't this smell like an uncaught interrupt?
You can put lipstick on a pig, but it is still a pig.
I've never met a pig I didn't like, as long as you have some salt and pepper.
- Log in or register to post comments
TopI see Lee is having his fun......
Update:
Ok, I have made some progress.
If I Stick with the original:
The program goes to that loop and stays there.
But if I do this:
It WORKS!! I can enter text on the terminal and it is echoed back
Or if I set a bit on PORTA:
This also works. I can enter text on the terminal and it is echoed back
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user
- Log in or register to post comments
TopWell there you go! You are not just a pretty face.
Thanks for proving my theory wrong too, I can confirm your findings. The counter must get reset to zero every time a new char comes in and gets printed out but the data is still going into the RX circular buffer.
John Samperi
Ampertronics Pty. Ltd.
https://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
TopYabbut I am still scratching my head as to WHY just having:
Is causing such a fuss. If it were a C issue I would think the compiler would spit up a fuss. Then again......
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user
- Log in or register to post comments
TopNot exactly.
If I wasn't constantly polling the counter, then it would increment by one every time a character came in. Then once I did poll the counter and see that it no longer was zero I would have to run a routine to read out the buffer and clear the counter(through GETCHAR() )
And make sure I poll and readout before the counter resets and the buffer is over written.
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user
- Log in or register to post comments
TopThis really doesn't make sense.
This...
...generates this code...
Which is exactly what you'd expect.
Whereas this...
...generates this...
Which is also what you'd expect.
We know the code works on a '328 because I've run it.
That leaves either some odd behaviour of the chip itself, something about the debug environment, or a hardware issue.
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopIt works fine on an A4U. I can't see any reason for an E5 to behave differently. Either the Compiler or the E5 chip.
I don't have an E5. Can anyone (other than Jim) confirm E5 behaviour?
From a debugger point of view. Move statements to separate lines. Easier to identify / set Breakpoints.
It makes no difference to the generated code.
If the low pin count E5 had a 128k or 256k family member, I would buy a board (or even a bare chip).
If someone can confirm the E5 misbehaviour, I will buy the E5 XPLD board to satisfy my scepticism.
David.
- Log in or register to post comments
TopWas that using Jim's posted code?
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopYes. Generate from CodeWizard file. (change device from 32E5 to 128A4U)
Do you own an E5 ?
It is Friday. So Farnell would not deliver an XPLD until Monday. I don't want to mess around with a bare chip.
David.
- Log in or register to post comments
TopFound my 32E5 breakout boards. A bit of a lash-up...
BUT...I can confirm Jim's findings.
This...
...does not work. Whereas this...
...does.
Very odd.
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopFor completeness I changed the first bit of code to this...
...with the same result.
Generated code for the non-working version...
And the working version...
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopOK, this gets weirder.
I've just run both ASM files through a Diff and the only differences are those in the generated code above.
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopThings that don't seem to make any difference....
1) Running TX and RX on different interrupt priority levels
2) Running on the same level but with Round Robin scheduling turned on
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopHave to come back to this later - it's Friday so it must be paperwork day.
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopAs to the issue here. I wonder if there's anyone who has both "traditional Xmega" and "E5" to compare behaviour on the two ?
- Log in or register to post comments
TopIs there some atomic protection that might be starved by the interrupts? The inclusion of a nop() would support that methinks.
- Log in or register to post comments
TopI get exactly the same as you. (as I would expect)
But my program works fine on the 128A4U target with or without the NOP.
I have far too many "evaluation boards". Hey-ho. My Farnell order for ATXMEGAE5-XPLD has just been placed.
David.
- Log in or register to post comments
TopThat's not a euphemism for panic-buying toilet roll, is it ... ?
Top Tips:
- Log in or register to post comments
TopA guess (I don't have the HW so I can't check).
perhaps
stops putchar from working, and the NOP (any delay) makes it work.
A way to test is to change baudrate. With the NOP a slower TX will also fail, and with faster the org. code will work.
- Log in or register to post comments
TopSorry; uncaught interrupt by default would jump to zero.
You can put lipstick on a pig, but it is still a pig.
I've never met a pig I didn't like, as long as you have some salt and pepper.
- Log in or register to post comments
TopInteresting findings.
I am not at my development PC today, but if someo e wants to try out a thought i had.....
Throw some code BEFORE the IF statement and remove the stuff after the IF and see what happens.
Another test is to add code before the IF statement, remove the else/NOP, and add some code to do something after the IF.
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user
- Log in or register to post comments
TopLook at the serial code - how is it doing the atomic protection?
- Log in or register to post comments
TopNot working...
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopOK, there's something odd going on as you switch between different optimisation levels.
Low and Speed optimisation works without the NOP, the other speed optimisations don't.
Ditto for the three size optimisations.
This is a vanilla file straight from the wizard with just the obvious additions at the bottom of main.
Attachment(s):
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopJim...
what happens if you turn the optimisation down to LOW?
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
Top>This is a vanilla file
Probably doesn't do much good without the lst file, as some do not have cv to compile with.
Put the nop as the first thing in the while loop, so every read via lds r30 is preceded by the nop. Doesn't seem like the lds r30 likes the back to back reads when no other memory access takes place between reads (lds r30, cpi r30, rjmp, rjmp). The nop does something, and you would think an interrupt that will take place would also 'correct' the problem (but maybe see below).
You could also try to get the buffer count read to use a pointer so the resulting code is not using lds r30, just to see what a different type of access acts like.
This is the end of the isr (from the jgm listing in the zip file, anyway)-
000200 91e9 LD R30,Y+
000201 bfef OUT SREG,R30
000202 91f9 LD R31,Y+
000203 91e9 LD R30,Y+
000204 91a9 LD R26,Y+
000205 9518 RETI
Maybe the the pointer register usage has something to do with it, as the isr leaves with its last memory access as a pointer type access. In the avr0/1, I saw a strange problem where writing to the sleep control register would not work when using a pointer register to access (compiler generated code used pointers for some reason, then the problem showed up), but either adding a nop or getting the compiler to produce lds/sts (normal), or splitting up the write into two ops 'fixed' the problem. Maybe there are combinations of x/y/z pointer use that create a problem, although if so it must be a rare combo or you would think it would be causing problems all over the place.
I'm not sure what can be done in cv, but if a nop could be inserted before the reti, that could also maybe reveal something useful. Maybe.
- Log in or register to post comments
TopOK, this is it from me for a day or so.
This works with Speed, Low optimisation...
As does this...
This does not work with Speed, Maximal...
Whereas this does...
[this is as much about reminding me where I got to as anything else]
[That said I am very confused and may be going down the wrong rabbit hole]
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopLike this?
Doesn't work.
The .lst file for this version (not working)...
...is attached.
Attachment(s):
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopDon't people read replies?
I was the first to confirm the beahviour in #67.
I was going to offer you the Xplained board I got from Atmel even before the E5 was released. This of course goes against my hoarder instinct....
John Samperi
Ampertronics Pty. Ltd.
https://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
TopThe situation appears widespread (at least two have recreated?), but is it time to gather the date code/chip rev of the various setups?
In that vein, I was going to peek at errata. Anyone have a hint to find the errata? The datasheet just says "go to microchip.com". And I saw no link in a pass at the product page.
You can put lipstick on a pig, but it is still a pig.
I've never met a pig I didn't like, as long as you have some salt and pepper.
- Log in or register to post comments
TopJesus guys, been following this post. Has anyone figured the problem yet? Strange!
- Log in or register to post comments
TopThe Xmega32E5 target is a barrier to many (including me).
I had a thought about using the simulator though. Has anyone been successful using the Atmel stimulus file (.stim) to inject characters into the simulator's USART ? (Documentation on .stim files is sparse)
- Log in or register to post comments
TopWhy? It's just a nice little chip. I have about 3,000 boards in the field with the E5.
John Samperi
Ampertronics Pty. Ltd.
https://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
TopI have to agree. It is a nice chip.
Back to topic,
I have a huge non-avr project I need to get on. And I also need to start/finish the one with the XMEGA in so I am going to get back to writing the application and watching the behaviour of things. I will email Pavel at some point and see if he has an explanation as to why things are happening. We shall see what the Big PoohBahh has to say.
Stay tuned Kiddies!
JIm
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user
- Log in or register to post comments
TopOne more thing to add.
I just fired up the program we have been dissecting and I deleted everything from teh WHIE() loop and hit RUN debugger. The code sits in the while loop and does not go to the WHILE loop in getchar().
Very interesting why either the MACRO, or writing the line of code itself in the while loop causes the problem...
All for now
Jim
I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie
"The critical shortage here is not stuff, but time." - Johan Ekdahl
"Step N is required before you can do step N+1!" - ka7ehk
"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman
"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?" - Lee "theusch"
Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-) - Source Unknown
Please Read: Code-of-Conduct
Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user
- Log in or register to post comments
TopWhat I meant by that is, because not many freaks can immediately lay their hands on some real silicon; that it's a barrier to solving the weird problem.
Hence my sub-question about injecting characters into the Atmel Simulator.
- Log in or register to post comments
TopMy 32E5-XPRO will arrive tomorrow.
It should be fairly simple to see whether the 32E5 silicon behaves differently to 32A4U silicon. Or even mega4809, tiny817, ... silicon.
Or whether Codevision does something different for 32E5.
I am intrigued. The 32E5 has been available for about 5 years. XmegaA1 was released in 2007. The Xmega, mega-0, tiny-0, tiny-1 have been available for several years. There is nothing "new" but of course silicon is revised, compilers are updated, ...
David.
- Log in or register to post comments
TopPages