Well i have recently started working with the XC1A kit, and i'm kind of... stuck
i can't make use of the clock leds, the button leds are not a problem, but when i try to use the clock leds is when things are starting to fail.
my code is something like this:
// initialize ports and assign them to variables
on stdcore [0] : out port clkled0 = PORT_CLOCKLED_0;
// the same for the others, 1, 2 and 3
then i use par {} when i'm tring to use the varaibles, and two other variables for red and green
but when i try to send a value to the port (clkled0 <: VALUE) results in nothing at all or leds i, ii, and iii always on, no matter what value i send
could any one point me in the right direction, what do i need to do?, i hope you can help me!!
A little help with XC1A?
-
- Junior Member
- Posts: 4
- Joined: Wed Feb 16, 2011 2:35 am
-
- Junior Member
- Posts: 4
- Joined: Wed Feb 16, 2011 2:35 am
Hi,
Well I have managed to find a solution for the Clock led problem, but I was wondering if anyone knew how can I make something like the getch or sleep function, so I can use it with my code?
Thanks in advance, I Hope someone could help me.
Well I have managed to find a solution for the Clock led problem, but I was wondering if anyone knew how can I make something like the getch or sleep function, so I can use it with my code?
Thanks in advance, I Hope someone could help me.
-
- Respected Member
- Posts: 259
- Joined: Thu Sep 16, 2010 9:15 am
For sleep you can use a timer (they are based on 16-bit counters), see the documentation.
And for getch I think you can use the UART routines... you have some of those IO functions in stdio, provided via newlib. I haven't used them myself, though.
And for getch I think you can use the UART routines... you have some of those IO functions in stdio, provided via newlib. I haven't used them myself, though.