| Author |
Message |
|
|
Posted: May 09, 2011 - 02:18 AM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
Right, thank you.. I hope not making the same mistake now, but still cannot find the interruption vectors...
The problem is I cannot find the part of the code dedicated to determine which interruption is generated,...
I have to add there, the filter to select the correct pin change interruption.
Another way to explain my question:
I understand that
HAL_RegisterIrq(IRQ_1, IRQ_LOW_LEVEL, bspKey1InterruptHandler);
is used something like "pass the new interrupt vector" through bspKey1InterruptHandler.
That's ok, but if I want to use the pin change interrupt, I have to check the PCIFx register to determine the correct pin change... I think this is not contemplated by the code right? |
|
|
| |
|
|
|
|
|
Posted: May 09, 2011 - 08:43 AM |
|


Joined: Apr 15, 2009
Posts: 4985
Location: San Jose, CA
|
|
| Well, there is no code to handle Pin Change interrupts in the HAL. So you need either add this code, or just define handlers in your application without modifying HAL, this will save you time when updating to the new version of BitCloud. |
|
|
| |
|
|
|
|
|
Posted: May 09, 2011 - 04:01 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
All right, I'll do that, but I need a starting point to insert my code.
Where are located bitcloud's interruption vectors?
Regards |
|
|
| |
|
|
|
|
|
Posted: May 09, 2011 - 04:07 PM |
|


Joined: Apr 15, 2009
Posts: 4985
Location: San Jose, CA
|
|
| For already defined regular interrupts (not Pin Change interrupts) they are located in HAL/avr/atmega1284/common/src/halIrq.c. |
|
|
| |
|
|
|
|
|
Posted: May 09, 2011 - 05:00 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
you mean the ISR(INT0_vect)function for example?
I couldn't find definitions of both, ISR and the vector.
Is that function defined in binary mode? |
|
|
| |
|
|
|
|
|
Posted: May 09, 2011 - 05:23 PM |
|


Joined: Apr 15, 2009
Posts: 4985
Location: San Jose, CA
|
|
|
troyka wrote:
I couldn't find definitions of both, ISR and the vector.
I don't understand what do you need. ISR() is the handler for the interrupt vector.
troyka wrote:
Is that function defined in binary mode?
Nothing hardware depended is closed. |
|
|
| |
|
|
|
|
|
Posted: May 09, 2011 - 05:37 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
Sorry that i'm not familiarized with ISR() handler, I'm mostly an assembler user and the procedure it's different.
I explain what I need:
On assembler, when the interruption is generated, the microcontroller jumps to a memory address, I'm trying to figure out what exactly happens on C and specifically how bitcloud handle that.
I assume that somehow when the interruption is generated, bitcloud can recognize different interruptions and automatically jump to ISR(INT0_vect) (if INT0 is fired)
I need to find that code who takes the decision to add the pin change code there too.
How much wrong I’m? |
|
|
| |
|
|
|
|
|
Posted: May 09, 2011 - 05:42 PM |
|


Joined: Apr 15, 2009
Posts: 4985
Location: San Jose, CA
|
|
|
troyka wrote:
Sorry that i'm not familiarized with ISR() handler,
It is a part of the standard C library (avr-libc). It has nothing to to with the BitCloud. You need to find a tutorial on this site or just read avr-libc documentation.
ISR(INT0_vect) basically generates ISR handler code and puts jmp instruction into a vector table at the appropriate offset (INT0 in this case).
So you'll need to define something like ISR(PCINT0_vect). |
|
|
| |
|
|
|
|
|
Posted: May 10, 2011 - 02:54 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
That information was very helpfull, thanks.
After made the Pin Change interruption handlers, I was doing some tests:
When disabled the external interruptions using
Code:
EMPTY_INTERRUPT(INT0_vect);
EMPTY_INTERRUPT(INT1_vect);
EMPTY_INTERRUPT(INT2_vect);
The external interruptions was still working.
And the last strange thing was that if I modify the code on halirq.c with an error syntax, it's still compiling...
Syntax errors on the main C file are detected but on halirq.c I can write a letter to Santa and compile it... any idea why?
already run "make clean all" |
|
|
| |
|
|
|
|
|
Posted: May 10, 2011 - 03:17 PM |
|


Joined: Apr 15, 2009
Posts: 4985
Location: San Jose, CA
|
|
|
troyka wrote:
any idea why?
After any change to the HAL you need to recompile it. Run "make clean all" in the HAL directory. Application just uses compiled library. |
|
|
| |
|
|
|
|
|
Posted: May 10, 2011 - 03:41 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
| Problem solved! thank you! |
|
|
| |
|
|
|
|
|
Posted: May 13, 2011 - 04:56 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
Just the same way there are "commands" to light up symbols on the raven's LCD, and to send text to the alphanumeric section. Is there any pre-defined function to send numbers to the display's time section?
Regards! |
|
|
| |
|
|
|
|
|
Posted: May 13, 2011 - 06:28 PM |
|


Joined: Apr 15, 2009
Posts: 4985
Location: San Jose, CA
|
|
|
troyka wrote:
Is there any pre-defined function to send numbers to the display's time section?
I have no idea, we use stock LCD driver firmware, so I suppose it should include those commands, but I don't know what they are. BSP for the Raven includes complete source code for the display firmware, you may look there. |
|
|
| |
|
|
|
|
|
Posted: May 18, 2011 - 10:07 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
Hi, testing the following code on the board:
Code:
char post_screen[7]=" ";
char num[10]="0123456789";
char alfa[37]="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
appSendLcdMsg(post_screen);
The display start to show up all the numbers and letters, I think the reason was that "post_screen" was taken like a pointer and not like a string...right?
How can I do that casting?
I found some solutions on the web but no success…
Thankyou for your help! |
|
|
| |
|
|
|
|
|
Posted: May 19, 2011 - 06:54 AM |
|


Joined: Apr 15, 2009
Posts: 4985
Location: San Jose, CA
|
|
|
troyka wrote:
I think the reason was that "post_screen" was taken like a pointer and not like a string...right?
I don't know what you did before, so I don't know what was wrong with it. |
|
|
| |
|
|
|
|
|
Posted: May 19, 2011 - 02:21 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
This is the most simple code I can do and the error is similar, this time, the display start shifting from right to left the characters: "1234567@@@@@@@BBBBBB1234567 " and start again...
The @ I don't know if it's exactly @, maybe is an "e"
Code:
void APL_TaskHandler(void)
{
char post_screen[7]="1234567";
char post_screen2[7]="890ABCD";
appOpenLcd();
appSendLcdMsg(post_screen);
}
|
|
|
| |
|
|
|
|
|
Posted: May 19, 2011 - 02:28 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
Problem solved, the array was bad dimensioned....
Thaks!! |
|
|
| |
|
|
|
|
|
Posted: May 19, 2011 - 07:45 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
Due to the last problem, I realise that all strings greater than 7 chars, the ATMEGA3290's functions automatically put the chars on a continuous rotating loop.
After that, all stream sended, (greater, equal or less than 7 chars) will participate on that continuous shifting...
Do you know any way to stop that shift?
regards. |
|
|
| |
|
|
|
|
|
Posted: May 19, 2011 - 08:52 PM |
|


Joined: Apr 15, 2009
Posts: 4985
Location: San Jose, CA
|
|
|
troyka wrote:
Do you know any way to stop that shift?
No, you should look into the 3290's code. I've never seen it myself. |
|
|
| |
|
|
|
|
|
Posted: May 28, 2011 - 07:12 PM |
|


Joined: Oct 28, 2009
Posts: 179
|
|
Could you please tell me where is located/documented the 3290's code?
Sure is not on bitcloud bundle.
Do you refer to the AVR2017: RZRAVEN Firmware? |
|
|
| |
|
|
|
|
|