Page 1 of 1

Interrupts?

Posted: Mon Feb 04, 2013 10:23 pm
by mamcgu
I am new to this processor/language and on reading the manual see no provision for interrupts, i.e. executing a certain routine on the change of state of a pin. The closest it comes is the Pulsin operation. Is this really all? In one of the applications I need to do, I must listen for sound echoes and do arithmetic on the times they come in. The echoes may be seconds apart.
Does the program pause during the execution of the Pulsin instruction?
Thanks,
Mark

Re: Interrupts?

Posted: Tue Feb 05, 2013 2:19 pm
by admin
The PULSIN and PULSOUT are blocking functions. Nothing else happens while they are executing except the background counter increments.

The manual on the web site matches firmware 0.63 and earlier. The latest firmware 0.64 is in testing and has external interrupt support on rising or falling edges on a few pins. The release date is Feb 14 or maybe a little earlier. The other enhancement is an instruction to communicate with the DHT-11 type humidity and temperature sensor.

With the interrupt support you will be able to perform a foreground task while waiting for events to occur. The interrupt causes a copy of the background counter to be stored when the interrupt occurs. You will know within 100us when the interrupt occurred even if you don't handle the event immediately.

Hope this helps.
Daniel

Re: Interrupts?

Posted: Tue Feb 05, 2013 10:31 pm
by mamcgu
I assume there is a way to update my board with the new firmware...?
Mark

Re: Interrupts?

Posted: Wed Feb 06, 2013 11:30 am
by admin
Yes, there is a way to update the firmware. If you see an updated manual and you would like the new firmware, send an email with the serial number on the bottom of the module and we will supply you the firmware and a recipe to install it on your module. All the recent fixes have been small bug fixes that occur very infrequently or under special circumstances. If we ever discover something big we will post it here and send e-mail to all the affected owners.

Re: questions

Posted: Sun Feb 10, 2013 9:52 pm
by mamcgu
I have been reading the manual and have a few questions:
If I wanted to convert a number, say and integer, to ascii for display on an lcd, which command should I use--bin$, bstr, byte$, or bytestr?
Is the ad# in inadc the pin number? or What?
Do peek and pike address nonvolatile memory? If so what should one use in <address>? How would you calculate this number? Is it in program space?
Is Port a pin? Or some combination of pins? How assigned?
Thanks,
Mark

Re: Interrupts?

Posted: Sun Feb 10, 2013 11:12 pm
by admin
Hi Mark

"If I wanted to convert a number, say and integer, to ascii for display on an lcd, which command should I use--bin$, bstr, byte$, or bytestr?"
Functions that return a string end in a $. BIN$ and BYTE$ will convert integer to ASCII representation (strings). BIN$ will produce a string on 1's ans 0's and byte$ will produce a string with characters from 0-9 in the string.

"Is the ad# in inadc the pin number?"
ad# is the pin number on the module. Valid numbers are 6, 7, 8, 10, 12, 13, 15, 21, 22, 24-29, 36. The description in the manual is terrible, it will be fixed in the next revision.

PEEK and POKE is constrained to be in the area of the peripheral registers of the LPC2136 and is intended (only) to control the on chip peripherals. You can't PEEK or POKE into RAM or FLASH.

PORT can take only two values, 0 and 1, and is the IO port number of the LPC2136. The LPC2136 has two 32-bit registers that control the digital states on the pins. The pin direction is set with PINMODE. The mapping from module pin number to LPC2136 bit in PORT0, 1 must be taken from the schematic. Use IND and OUTD instead to control individual pins.

I hope this helps.