1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-25 22:39:22 +02:00
Commit Graph

281 Commits

Author SHA1 Message Date
Werner Almesberger
6909fc232a atusb/fw/Makefile: introduce target-specific compliation variants
- Makefile (USB_OBJS): moved into OBJS and BOOT_OBJS
- Makefile (OBJS): atu2.o is now app-atu2.o
- Makefile (BOOT_OBJS): atu2.o is now boot-atu2.o
- Makefile (MKDEP, %.o): moved dependency generation to macro $(MKDEP)
- Makefile (app-%.o): build from usb/%.c
- Makefile (boot -%.o): build from usb/%.c and set -DBOOT_LOADER
2011-06-26 06:56:01 -03:00
Werner Almesberger
23c592250e atusb/fw/board_app.c: do not read and accumulate IRQs; flash LED when EP1 busy
To indicate an interrupt, we just send a zero byte.
2011-06-23 13:03:34 -03:00
Werner Almesberger
27fc0a0e2c atusb/fw/: aggregate interrupts while waiting
- board_app.c (INT0_vect): always read IRQ_STATUS, even if an
  interrupt is already enqueued
- board_app.c (INT0_vect): if an interrupt is enqueued, accumulate
  the interrupts signaled since
- board_app.c (irqs_more): when a pending transfer completes, send
  interrupts accumulated since (if any)
2011-06-23 09:41:40 -03:00
Werner Almesberger
f7b9a18917 atusb/fw/: new request ATUSB_GPIO_CLEANUP to re-enable INT0
- board.h (gpio_cleanup), board_app.c (gpio_cleanup): restore INT0
  when done manipulating GPIOs
- board.c (gpio): updated comment explaining how to restore INT0
- include/atusb/ep0.h (enum atspi_requests), ep0.c
  (ATUSB_GPIO_CLEANUP): new request to return to normal operation
  after ATUSB_GPIO
2011-06-20 23:11:09 -03:00
Werner Almesberger
12fef1b196 atusb/fw/: disable INT0 if manipulating GPIOs (tentative)
Since GPIO manipulations may cause stray INT0 activity, we turn off
INT0 handing on ATUSB_GPIO. The MCU must be reset to restore access
to INT0.

There are still issues to resolve with the GPIO test. It may turn
out that there's a less invasive solution than just turning off
INT0 completely.

- board_app.c (gpio): mask INT0 before manipulating GPIOs
- board_app.c (board_app_init): make it clearer that EIMSK is a bit
  mask
2011-06-20 20:50:22 -03:00
Werner Almesberger
0120f62242 atusb/fw/: added reporting of RF interrupts via bulk EP1
- board.h (board_app_init), board_app.c (board_app_init): new function
  for application-specific board initialization
- atusb.c (main): call board_app_init
- board_app.c (INT0_vect): on RF interrupt, read REG_IRQ_STATUS and
  send the status byte on EP1
- board_app.c (board_app_init): set up interrupt on rising edge of
  INT0 (INT_RF)
- descr.c (config_descriptor): added EP1 as bulk IN
2011-06-20 15:49:33 -03:00
Werner Almesberger
244e449131 atusb/fw/usb/: added support for bulk IN EP 1
The code is quite special-cased. Some more changes will be necessary
for interrupt or OUT EPs.

- atu2.c (NUM_EPS): increased from 1 to 2
- atu2.c (ep_rx): send zero-length packet also for EPs != 0
- atu2.c (handle_ep): clear FIFOCON when sending data on EP != 0
- atu2.c (ep_init): configure EP 1 as bulk IN with size 64
- usb.c (NUM_EPS): we don't need to define NUM_EPS here
2011-06-20 14:34:08 -03:00
Werner Almesberger
3f74098ce2 atusb/fw/ep0.c (my_setup): fixed test for ATUSB_SPI_READ2 2011-06-20 13:43:17 -03:00
Werner Almesberger
9a0184cacb atusb/fw/: new mechanism for SPI commands (more general than reg/buf requests)
- ep0.c (setup_request): store combined request code in "req", for
  later reuse
- include/ep0.h (ATUSB_SPI_WRITE, ATUSB_SPI_READ1, ATUSB_SPI_READ2),
  ep0.c (setup_request): new requests that translate easily into
  general SPI operations
2011-06-19 15:50:49 -03:00
Stefan Schmidt
a48c6dcb30 usb/dfu.h: Include usb.h to avoid gcc warning
With warnings treated as errors I get this:
In file included from flash.c:19:0:
usb/dfu.h:107:35: error: 'struct setup_request' declared inside parameter list
usb/dfu.h:107:35: error: its scope is only this definition or declaration, which
 is probably not what you want
make: *** [flash.o] Error 1

Struct setup_request is declared in usb.h so include it.

Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
2011-06-17 12:01:38 -03:00
Werner Almesberger
ce16a16f73 atusb/fw/atusb.c (main): sleep (idle mode) while waiting for interrupts
This saves about 2 mA, leaving about 8 mA when idle. The transceiver
should consume 0.5 mA in TRX_OFF, CLKM up to 4 mA, and the idle MCU
core 1 mA. USB current is unknown.
2011-06-11 14:31:13 -03:00
Werner Almesberger
b42577bb72 atusb/fw/boot.c: adjusted the delay loop and don't race with dfu-util
- boot.c (MS_TO_LOOPS): increased loop count now that we no longer
  have to poll
- boot.c (main): increased delay from 2.0 s to 2.5 s, because we were
  racing with a sleep(2) in dfu-util
2011-06-11 14:26:52 -03:00
Werner Almesberger
376236949b atusb/fw/usb/: we were busy-looping on TXINI. Mask the interrupt when idle.
- usb/usb.h (usb_ep_change), usb/atu2.c (usb_ep_change): new function
  called by the USB stack to notify the hardware-specific driver of
  an endpoint state change (EP_TX or EP_RX)
- usb/usb.c (usb_io): call usb_ep_change
- usb/atu2.c (handle_ep): mask TXINI if we have nothing to send
2011-06-11 14:17:44 -03:00
Werner Almesberger
d03beb2257 atusb/fw/: changed USB stack to use interrupts instead of polling
Note: this change surprisingly _increases_ the DFU wait in the boot
loader. Not yet sure why.

- boot.c (main): move the interrupt vectors to the boot loader
  section
- atusb.c (main): move the interrupt vectors to the application
  section
- boot.c (main): enable global interrupts while looping (disable
  them before jumping to the application)
- board_app.c (__timer_read, timer_read): removed wrapped since
  we're now always called with interrupts disabled
- usb/atu2.c (ep_init): enable endpoint interrupts
- usb/atu2.c (usb_init): enable device interrupts
- usb/atu2.c (usb_poll, USB_GEN_vect, USB_COM_vect): moved poll
  loop code into separate handlers for device and endpoint
  interrupts
- boot.c (main), atusb.c (main): removed call to usb_poll
2011-06-11 11:06:18 -03:00
Werner Almesberger
f9681e5b4f atusb/fw/usb/atu2.c: use implicit race-free "and" when writing to UDINT/UEINTX
The old code could accidently acknowledge interrupts that appeared
between the read and the write in UxINTx &= mask.

- atu2.c (handle_ep): writing to UEINTX implies a race-free "and"
- atu2.c (usb_poll): writing to UDINT implies a race-free "and"
2011-06-11 08:16:23 -03:00
Werner Almesberger
a69916da52 atusb/fw/: make timer code use interrupts instead of polling
- board_app.c (timer_poll): replaced with interrupt handler
- board_app.c (__timer_read): merged polling of timer_poll into the
  read loop (so it works as before, provided that interrupts are
  disabled)
- board_app.c (timer_read): run __timer_read with interrupts disabled
- board_app.c (timer_init): enable timer 1 overflow interrupt
- atusb.c (main): enabled global interrupts
- atusb.c (main): don't call poll_timer anymore
- board.h (timer_poll): removed
2011-06-11 08:13:31 -03:00
Werner Almesberger
2acdaca218 atusb/fw/: moved timer initialization to board_app.c as well
- board.c (board_init), board_app.h (timer_init), board_app.c
  (timer_init): moved timer initialization from board_init to
  new function timer_init
- atusb.c (main): call timer_init
2011-06-11 01:52:16 -03:00
Werner Almesberger
2d7ee91430 atusb/fw/: added transition from runtime to DFU mode according to DFU spec
- descr.c (config_descriptor): added DFU interface descriptor
- ep0.c (my_dfu_setup, my_set_interface, ep0_init): added DFU
  interface switching
- ep0.c (my_reset, ep0_init): CPU-reset (into boot loader) on
  USB bus reset when in appDETACH
- Makefile (OBJS): added dfu_common.o
2011-06-10 23:26:36 -03:00
Werner Almesberger
5f50611735 atusb/fw/usb/: DFU_ITF_DESCR also needs a protocol argument
- dfu.h (enum dfu_itf_proto): bInterfaceProtocol values for DFU
  functional descriptor
- dfu.h (DFU_ITF_DESCR): added protocol argument
- dfu.c (config_descriptor): pass protocol to DFU_ITF_DESCR
2011-06-10 23:15:51 -03:00
Werner Almesberger
2544004a86 atusb/fw/: moved common elements of DFU processing to dfu_common.c
- dfu.c (functional_descriptor, dfu, my_descr), dfu.h (dfu_my_descr):
  moved to dfu_common.c
- dfu.c (my_setup), dfu.h (dfu_setup_common), dfu_common.c
  (dfu_setup_common): moved handling of DFU_GETSTATUS, DFU_CLRSTATUS,
  and DFU_GETSTATE from my_setup to dfu_setup_common
- dfu_common.c (my_descr), dfu.c (dfu_init): renamed my_descr to
  dfu_my_descr
- Makefile (BOOT_OBJS): added dfu_common.o
2011-06-10 22:04:12 -03:00
Werner Almesberger
bbe27fc357 atusb/fw: revert most of the user_setups change and use simple callback instead
This allows us to do other things as well, e.g., change state.

- ep0.c (ep0_init), usb/dfu.c (dfu_init): use user_setup
- usb/atu2.c (usb_poll): no need to reset user_setup - the user's
  reset function can do that
- usb/usb.h (user_setups), usb/usb.c (handle_setup): removed
  user_setups
- usb/usb.h (user_set_interface), usb/usb.c (user_set_interface,
  handle_setup): callback for SET_INTERFACE
2011-06-10 21:50:42 -03:00
Werner Almesberger
7a2c785e29 atusb/fw/usb/dfu.h: define DFU interface descriptor, for later sharing
- dfu.h (DFU_ITF_DESCR): define DFU interface descriptor
- dfu.c (config_descriptor): use DFU_ITF_DESCR instead of open-coding
  the descriptor
2011-06-10 19:33:24 -03:00
Werner Almesberger
3cc92cc4a6 atusb/fw/: define USB bus current (40 mA) in board.h based on measured value
The measured values are:

board idle, looping	  9 mA
LED on			+ 5 mA
TX CW (+3 dBm)		+14 mA
			------
			 28 mA
			======

Adding a margin of 12 mA, we get 40 mA. DFU used 30 mA so far, the
application 50 mA.

- board.h (BOARD_MAX_mA): define maximum USB bus current
- descr.c (config_descriptor), usb/dfu.c (config_descriptor):
  use BOARD_MAX_mA for bMaxPower instead of hard-coding values
2011-06-10 19:33:24 -03:00
Werner Almesberger
89d13ce8f8 atusb/fw/: SET_INTERFACE can now select among interfaces (changes user_setup)
- ep0.c (ep0_init), usb/dfu.c (dfu_init): set user_setups[0] instead
  of user_setup
- usb/atu2.c (usb_poll): reset user_setup on bus reset
- usb/usb.h (user_setups), usb/usb.c (user_setups): array of
  interface-specific setup functions
- usb/usb.c (handle_setup): in SET_INTERFACE, select setup function
  from user_setups according to interface
- usb/usb.c (handle_setup): if user_setup is not set (e.g., the
  optional SET_INTERFACE was never issued), fall back to user_setups[0]
2011-06-10 17:12:57 -03:00
Werner Almesberger
256ac01ab2 atusb/fw/board.c (reset_rf): increased 1 us delays to nominally 2 us
They should be at least 625 ns. Can't hurt to have a little tolerance.
2011-06-09 20:55:33 -03:00
Werner Almesberger
ec7c93789a atusb/fw/: added "lazy enabling" of UART-SPI after ATUSB_GPIO
- spi.h (spi_off), spi.c: disable the UART
- spi.c (spi_initialized, spi_begin, spi_init): initialize the UART
  if necessary
- board_app.c (gpio): call spi_off to disable the UART instead of
  open-coding the operation
- board_app.c (gpio): don't explicitly re-enable the UART but defer it
  to the next communication
2011-06-09 14:02:26 -03:00
Werner Almesberger
814cf6fd78 atusb/fw/boot.c (main): reset_rf implies spi_init - no need to call it here 2011-06-09 12:52:51 -03:00
Werner Almesberger
ed6d43bb35 atusb/fw/board_app.c: removed unnecessary includes 2011-06-09 12:51:13 -03:00
Werner Almesberger
e678401ac3 atusb/fw/: split board functions into app-only/shared part (boot overlflowed)
- board.c (timer_h, reset_cpu, read_irq, slp_tr, timer_poll,
  timer_read, gpio): moved to new file board_app.c
- Makefile (OBJS): added board_app.o
2011-06-09 12:48:44 -03:00
Werner Almesberger
b41076135c atusb: include the position of fiducials in atusb-pos.csv (for fab)
The SMT fab was looking there for the positions (alas, in vain).
Seems as good a place as any.

- atusb.brd: bumped file version to 20110607 (didn't change the version
  printed on the layout since the layout itself didn't change)
- atusb.brd: changed fiducials from "virtual" to "normal+insert", to
  include them in the position report
- atusb.brd: renamed the fiducials to give them unique names
- Makefile: bumped fab files version to 20110607
2011-06-07 16:51:26 -03:00
Werner Almesberger
e42203b723 atusb/fw/: new request ATUSB_SLP_TR to pulse SLP_TR
- include/atusb/ep0.h (enum atspi_requests): added ATUSB_SLP_TR
- ep0.c (my_setup): call slp_tr on ATUSB_SLP_TR
- board.h (slp_tr), board.c: pulse SLP_TR high
2011-06-05 22:34:49 -03:00
Werner Almesberger
e6f7d85e8a atudb/fw: disable the UART in ATUSB_GPIO
- board.c (gpio): split GPIO setup and probing
- board.c (gpio): disable the UART while probing GPIOs
2011-06-05 18:27:40 -03:00
Werner Almesberger
370cd320ef atusb/fw: new request ATUSB_GPIO for direct GPIO access
reset_rf now resets all GPIOs to their default state. This way, we
can easily recover from an incomplete or incorrect use of ATUSB_GPIO.

- atusb.c (main), board.c (reset_rf): moved call to spi_init into
  reset_rf
- board.c (reset_rf, board_init): moved GPIO setup to reset_rf
- board.c (reset_rf): set GPIOs to reset defaults
- board.h (gpio), board.c: read/modify/write all settings of GPIO
  ports
- include/atusb/ep0.h (enum atspi_requests): added new request
  ATUSB_GPIO
- ep0.c (my_setup): ATUSB_GPIO reads/reconfigures a GPIO port
2011-06-04 10:29:10 -03:00
Werner Almesberger
b733431847 atusb/fw/ep0.c: fixed ATUSB_SRAM_READ
- ep0.c (my_setup): ATUSB_SRAM_READ is FROM_DEV, not TO_DEV
- ep0.c (my_setup): in ATUSB_SRAM_READ, write setup->wLength bytes,
  not "size" (which is uninitialized)
2011-06-03 14:25:19 -03:00
Werner Almesberger
8c57277953 atusb/fw/: added free-running 48 bit 8 MHz counter for clock measurements
- atusb.c (main): poll the 16 bit timer for overflows
- board.h (timer_poll, timer_read), (board.c (timer_h, timer_poll,
  timer_read, board_init): added support for a free-running 48 bit timer
  (16 bits in hardware, 32 bits in software)
- include/atusb/ep0.h (ATUSB_TIMER), ep0.c (my_setup): new request
  ATUSB_TIMER to retrieve the value of the 8 MHz counter
- include/atusb/ep0.h (enum atspi_requests): describe what the groups
  of requests do
2011-05-29 21:05:28 -03:00
Werner Almesberger
8a436b8abd atusb/: swapped C10 and C13 in schematics, to match layout
- atrf.sch: C10 (EVDD bypass) and C13 (DEVDD bypass) had their roles
  swapped in the layout. Swapped them in the schematics to match the
  layout.
- atusb.brd: updated the netlist
- atusb.sch, usb.sch: commit noise
2011-05-27 04:29:01 -03:00
Werner Almesberger
926ed26188 atusb: varistor Vdc was off by 100 mV; made it clearer that we use Vdc, not Vb
- atusb/atusb.sch, atusb/usb.sch, atusb/atrf.sch: bumped schematics
  version to 20110519
- atusb/usb.sch (VR1, VR2, VR3): changed voltage from 5.6 V to 5.5 V
- atusb/usb.sch (VR1, VR2, VR3): clarified that the voltage is Vdc, not Vb
- bom/atrf.chr (AVR-M1005C080MTACB): Vdc is 5.5 V, not 5.6 V
- bom/atrf.sub (VR[0-9]*): allow #.#Vdc as an alternative to #V#
2011-05-19 14:23:33 -03:00
Werner Almesberger
b82db55f4a atusb/fw/Makefile: new target "update" to update the application via DFU
- Makefile (USB_ID, dfu): moved USB ID to variable, for sharing
- Makefile (.PHONY, update): new target to reset atusb and to DFU new
  firmware
2011-05-11 05:29:54 -03:00
Werner Almesberger
85f60de9d5 atusb/fw: use the unique serial number of the ATmega8/16/32U2 for iSerialNumber
- usb/usb.h (USB_LANGID_ENGLISH_US): added USB LANGID for US-English
- board.h (board_sernum), board.c (board_sernum, hex, get_sernum,
  board_init): provide the board's serial number in "board_sernum"
  (UTF-encoded)
- sernum.h (sernum_get_descr), sernum.c (sernum_get_descr): return
  string descriptors for the serial number
- descr.c (device_descriptor), usb/dfu.c (device_descriptor):
  set iSerialNumber if serial number is available
- atusb.c (main), usb/dfu.c (my_descr): call sernum_get_descr for
  unknown descriptors
- Makefile (OBJS, BOOT_OBJS): added sernum.o
2011-05-10 17:23:08 -03:00
Werner Almesberger
fd91546c59 atusb/fw/Makefile (dfu): our functional descriptor is fine, no need for -t
What caused the error that looked like a problem with the functional
descriptor was in fact the boot loader resetting between the bus scan
and retrieval of the descriptor.
2011-05-10 11:53:32 -03:00
Werner Almesberger
ddd0022350 atusb/fw/boot.c (main): don't time out until there is an application
This prevents the boot loader from resetting all the time and makes
it easier to "catch" it with dfu-util.
2011-05-10 11:51:46 -03:00
Werner Almesberger
fc1a334bf6 atusb/fw/usb/dfu.c (dfu): lowered bwPollTimeout from 1 s to 100 ms and explained why 2011-05-10 08:32:12 -03:00
Werner Almesberger
42dae8dde2 atusb/fw: implemented ATUSB_RESET
- board.c (board_init): disable the watchdog timer (tricky !)
- board.h (reset_cpu), board.c: enable the watchdog timer to cause a
  CPU reset
- ep0.c (my_setup): uncommented and updated ATUSB_RESET handler
2011-05-09 23:52:00 -03:00
Werner Almesberger
6179f31fc0 atusb/fw/README: boot loader flashing time was a bit too optimistic (15 -> 30 s) 2011-05-09 23:44:51 -03:00
Werner Almesberger
1f99435bba atusb/fw/README: updated for complete firmware upload process 2011-05-09 22:06:33 -03:00
Werner Almesberger
0db361d49d atusb/fw/Makefile (dfu): pass transfer size to hide DFU non-compliance
We currently don't provide the DFU Functional Descriptor, which modern
versions of dfu-util request to determine the transfer size. Luckily,
they don't do this if the transfer size is given on the command line.
2011-05-09 22:02:28 -03:00
Werner Almesberger
eeb3af6a03 atusb/fw: fixed USB bus reset handling by software
- usb/atu2.c (ep_init): moved before usb_poll
- usb/atu2.c (usb_poll): register bit was used as mask, not as shift
- usb/atu2.c (usb_poll): call ep_init on USB bus reset
- usb/atu2.c (usb_reset): don't make USB bus reset force a hardware reset
- Makefile (.PHONY, dfu): new target to upload the application with DFU
2011-05-09 21:13:41 -03:00
Werner Almesberger
c5992bc675 atusb/fw/Makefile (.PHONY): added development-only phony targets 2011-05-09 21:12:26 -03:00
Werner Almesberger
f4342f49ae atusb: enlarged USB positioning pin hole; general cleanup
- modules/usb_a_plug_smt.fpd: enlarged hole for positioning pins from
  1.1 mm to 1.15 mm
- atusb/usb.sch, atusb/atusb.cmp, atusb/atusb.brd: removed trailing space
  from CON1's value
- atusb/atusb.sch, atusb/usb.sch, atusb/atrf.sch: schematics title still
  said AT86RF230, not 231
- atusb/README-SMT: corrected a typo
- atusb/README-PCB: specified the tolerance of the hole for the positioning
  pins of the USB connector
- atusb/README-PCB: added the 16-17 mm hole for the USB connector to the
  specification
- atusb/: bumped all version numbers to 20110330
2011-03-31 03:27:11 -03:00
Werner Almesberger
6487c32387 atben/README-PCB, atusb/README-PCB: clarifications regarding holes
- atben/README-PCB, atusb/README-PCB: illustrations now contain holes
- atben/README-PCB, atusb/README-PCB: clarified distinction antenna via
  vs. hole
2011-03-29 07:53:03 -03:00
Werner Almesberger
74706cfae8 atusb.brd: updated USB-A-PLUG-SMT footprint (fped put the layers wrong) 2011-03-24 21:19:08 -03:00
Werner Almesberger
6ff2740e9b atusb.brd: moved FIDUCAL label away from mounting hole; bumped version number
- atusb.brd: "FIDUCIAL" label was on hole; moved it
- atusb.brd: bumped version to 110325
2011-03-24 13:17:04 -03:00
Werner Almesberger
269f77079a added the front solder paste to the PCB fab package (for stencil production)
- atben/README-PCB, atusb/README-PCB: added *-SoldP_Front.gtp
- makefiles/Makefile.kicad (GERBERS): added $(NAME)-SoldP_Front.gtp
- makefiles/Makefile.kicad (gerbv): also show the board edge
2011-03-24 13:12:00 -03:00
Werner Almesberger
1c4c78e110 atusb.brd: added two vias to connect front and back ground at USB shield 2011-03-24 12:45:35 -03:00
Werner Almesberger
38bea8ec54 README-SMT: various small clarifications
- atben/README-SMT, atusb/README-SMT: added "component to "orientation"
- atben/README-SMT, atusb/README-SMT: added "drawings" to "footprint
  reference"
- atben/README-SMT, atusb/README-SMT: mention once more that the automatic
  insertion file is for the front only
2011-03-24 12:18:14 -03:00
Werner Almesberger
f242368deb atben. atusb: bumped version numbers to 110324 2011-03-24 05:07:50 -03:00
Werner Almesberger
af6d563194 README-PCB: relaxed antenna via size from 8 mil to <= 15 mil 2011-03-24 00:26:10 -03:00
Werner Almesberger
7e20be97dc atben.brd, atusb.brd: set solder mask opening of fiducials to 2 mm
- atben/atben.brd, atusb/atusb.brd: set solder mask clearance of fiducials
  to 0.1 mil, so that the real solder mask opening has a diameter of
  almost) exactly 2 mm (instead of 2 mm plus 10 mil)
2011-03-23 23:46:44 -03:00
Werner Almesberger
16ac7e5f4b miscellaneous integration of fiducials
- atben/atben.brd, atusb/atusb.brd: set insertion of fiducials to
  "virtual"
- makefiles/Makefile.kicad ($(NAME)-footprints.pdf): added FIDUCIAL
2011-03-23 17:44:59 -03:00
Werner Almesberger
7a9e5185b9 atusb: added two fiducial marks
- atusb.pro: added fiducial.mod
- atusb.brd: added two fiducial marks
- atusb.brd: adjusted RF and RF power ground zones
- atusb.brd (CON1): moved component reference out of the way
- atusb.brd: bumped version to 110323
2011-03-23 13:08:48 -03:00
Werner Almesberger
c3357216a5 atusb/atusb.brd: some more silk screen cleanup
- atusb.brd (C22): properly aligned reference with component center
- atusb.brd (P11, P12, P13, P14): moved reference below the pad, for
  consistency with P15 and P16
- atusb.brd (CON1): centered the component reference
2011-03-23 12:48:34 -03:00
Werner Almesberger
2aed5153ca generate SMT fab package
- makefiles/Makefile.kicad ($(NAME)-PCB_Edges.dxf, $(NAME).drl): since we
  now name the files explicitly, we need to generate them explicitly as
  well
- makefiles/Makefile.kicad (upload): added SMT fab package
- atben/Makefile (VERSION), atusb/Makefile (VERSION): bumped fab file
  version to 110323
2011-03-23 04:57:32 -03:00
Werner Almesberger
507e6c33de added project-specific footprint reference for SMT fab
- makefiles/Makefile.kicad: added generation of a footprint reference
- atben/README-SMT, atusb/README-SMT: added footprint reference, with
  explanation
2011-03-23 04:47:21 -03:00
Werner Almesberger
2e5329039c include overview images in PCB and SMT fab packages
- atben/README-PCB, atusb/README-PCB: added overview images for PCB front
  and back
- atben/README-SMT, atusb/README-SMT: added overview image for PCB front
- atben/README-SMT, atusb/README-SMT: clarified that the Gerbers are in
  the PCB archive
- makefiles/Makefile.kicad (PCB_FILES): moved list of gerbers to
  $(GERBERS)
- makefiles/Makefile.kicad (gerber): generate Gerbers only if necessary
- makefiles/Makefile.kicad (overview, uoverview, clean): renamed
  overview.png to $(NAME)-overview.png and turned phony target into file
  target
- makefiles/Makefile.kicad ($(NAME)-front.png, $(NAME)-back.png, clean):
  added generation of front and back images
2011-03-23 01:57:55 -03:00
Werner Almesberger
d53c2c2b72 added generation of SMT fab file package (in progress)
- atben/README-SMT, atusb/README-SMT: description for SMT fab files
- bom/Makefile (%-smt.csv, spotless): renamed *-smt.csv to *-bom.csv
- makefiles/Makefile.kicad (fab): split into "fab" (PCB and SMT) and
  fab-pcb (previous "fab"; only PCB)
- makefiles/Makefile.kicad (fab-smt): added packaging process for SMT
  fab files
2011-03-23 01:31:34 -03:00
Werner Almesberger
0782a3ce98 atusb: updated QFN footprints and version
- atusb.brd (U1, U2): updated QFN32-VHHD-2 and QFN32-VHHD-6 footprints
  (for solder paste size change)
- atusb.brd, Makefile (VERSION): bumped version number to 110322
2011-03-22 12:58:12 -03:00
Werner Almesberger
936d8076d9 atben, atusb: added comments specifying the grid sizes
- atben/atben.brd: added comment that grid is 0.1 mm
- atusb/atusb.brd: added comment that grid is 5 mil
2011-03-22 12:37:16 -03:00
Werner Almesberger
6caa0d36ab consolidated atben/Makefile and atusb/Makefile into common template
- makefiles/Makefile.kicad: common template for (some) KiCad projects
- atben/Makefile, atusb/Makefile: use makefiles/Makefile.kicad
2011-03-22 12:37:16 -03:00
Werner Almesberger
0960497602 atben, atusb: added Makefile targets to generate "pretty" overview images
- Makefile (overview): run prettygerbv to generate an overview image
- Makefile (uoverview): copy the overview image to
  downloads.qi-hardware.com and version it
- Makefile (clean): remove overview.png
2011-03-22 10:29:45 -03:00
Werner Almesberger
f1586fffd5 atben, atusb: updated back solder mask status (it's no longer empty)
- atben/Makefile (gerbv), atusb/Makefile (gerbv): show also the back
  solder mask layer
- atben/README-PCB, atusb/README-PCB: don't claim the back solder mask
  is empty
2011-03-22 10:03:19 -03:00
Werner Almesberger
44b49fd054 atusb.brd: more silk screen cleanup
- atusb.brd (R3): aligned reference with center of component
- atusb.brd (C16): moved component reference to less crowded place
2011-03-22 06:52:57 -03:00
Werner Almesberger
ef606f5df9 atusb.brd: some more component reference adjustments
- atusb.brd (P15, U1, VR3): moved to less crowded locations
2011-03-22 04:57:20 -03:00
Werner Almesberger
64a746b58d atben, atusb: set solder mask clearance to 5 mil and adjusted silk screen
- atben.pro, atusb.pro: set solder mask clearance to 5 mil
- atben.brd, atusb.brd: reduced silk screen outline of 0402 components
  from 5 to 3 mil
2011-03-22 03:22:39 -03:00
Werner Almesberger
18b2b919dc atben, atusb: always invoke KiCAD with absolute paths lest .pro be ignored
- atben/Makefile, atusb/Makefile (SCH, BRD): abstract path to .sch and
  .brd via variables
- atben/Makefile, atusb/Makefile (gerber, fab): pass absolute path to
  board file to pcbnew
- atben/Makefile, atusb/Makefile (gerber): put all options before the
  file name argument
2011-03-22 02:21:26 -03:00
Werner Almesberger
f17bcebce7 atusb: moved measurements to Drawings and merged Comments into silk screen
- atusb.brd: enabled Drawings layer
- atusb.brd: moved board dimensions to Drawings layer
- Makefile (clean): added $(NAME)-Drawings.gbr
- Makefile (GMERGE, gerber): use "gmerge" to merge Comments (which now
  only contains the component references) into SilkS_Front
- Makefile (gerbv): Comments is now redundant; removed it
2011-03-15 01:43:08 -03:00
Werner Almesberger
83d47a8826 atusb/Makefile (spotless): new target to also remove KiCAD "junk" files 2011-03-15 00:25:10 -03:00
Werner Almesberger
1cb69d1569 atusb.brd: changed version from 110314 to 110314
- Makefile (VERSION): bumped version from 110314 to 110314
- atusb.brd: bumped version on copper and re-generated version on silk
  screen
- atusb.brd: bumped version in board meta-data
2011-03-14 21:43:53 -03:00
Werner Almesberger
eac6e3c70b atben/README-PCB, atusb/README-PCB: various minor clarifications
- README-PCB: added imperial units for board thickness
- README-PCB: changed surface finish recommendation to prefer ENIG more
  strongly
- README-PCB: removed instructions for Gerber file generation from
  "interpretation of files section"
- README-PCB: mention common coordinate system origin
2011-03-14 21:31:55 -03:00
Werner Almesberger
6b3a049003 atben: set origin for fab files to lower left corner of board
- atusb/Makefile (gerber, fab): use pcbnew with --origin=aux for Gerber,
  drill, and DXF
- atusb/atusb.brd: set auxiliary origin to lower left corner of board
2011-03-14 13:27:15 -03:00
Werner Almesberger
695f6c2d57 atusb: use cptx to copy the version number to the silk screen
- Makefile (cptx): new target to update the version number on the silk
  screen
- atusb.brd: duplicated the version number from the back copper on the
  front silk screen
- atusb.brd: moved author tag to make room for front version number
2011-03-14 13:26:54 -03:00
Werner Almesberger
34d236cb38 atusb.brd (B1): moved component reference which overlapped with circle 2011-03-14 02:22:40 -03:00
Werner Almesberger
c06ed9e60f atusb.brd: specified which components to place (for SMT fab)
- atusb.brd (ANT1, P11...P16): marked as "virtual"
- atusb.brd (C16): marked as "normal" (not "normal+insert")
2011-03-14 02:18:54 -03:00
Werner Almesberger
970695c472 atben, atusb: added polarity markers
- atben.brd (B1), atusb.brd (B1): marked pin 1 location with a circle
- atusb.brd (D1): marked anode with a plus sign and moved the component
  reference
2011-03-14 02:14:11 -03:00
Werner Almesberger
fffa6e9867 atben/atusb: added -pcb to PCB fab archives; added "upload" target
- atben/Makefile (fab), atusb/Makefile (fab): changed name of PCB fab
  archives from $(NAME)-$(VERSION)... to $(NAME)-pcb-$(VERSION)...
- atben/Makefile (upload), atusb/Makefile (upload): new target to
  upload PCB fab archives to
  http://downloads.qi-hardware.com/people/werner/wpan/fab/
2011-03-14 00:33:40 -03:00
Werner Almesberger
cdf3825d24 atusb: added fab file generation, like in atben
- Makefile (VERSION, DIR): added board version and parent directory name
- Makefile: added generation of Gerbers and other fab files
- Makefile (gen): this never worked, changed --plot to --plot=ps
- Makefile: added section titles
- README-PCB: PCB making instructions
2011-03-12 23:43:00 -03:00
Werner Almesberger
d233c04c86 atusb/fw: implemented USB bus reset (to host) and polling of reset from host
- usb/usb.h, usb/atu2.c (usb_reset): reset the USB bus by detaching and
  re-attaching the device
- boot.c (main): force a USB reset before running the payload
- usb/atu2.c (usb_poll): test for USB reset from the host (in progress)
- usb/dfu.c (my_reset, dfu_init): register user USB reset handler
2011-03-11 17:56:41 -03:00
Werner Almesberger
e5571a26c3 atusb/fw/usb/atu2.c (handle_ep): cancel RX/TX if we receive a SETUP 2011-03-11 17:56:41 -03:00
Werner Almesberger
c265151d2b atusb/fw: introduced function flash_end_write to properly finish flashing
- dfu.h (flash_end_write), flash.c (flash_end_write): write any incomplete
  buffer
- flash.c (flash_write, flash_end_write): call boot_rww_enable only at the
  very end, it won't erase our buffer in mid-page
- usb/dfu.c (my_setup): call flash_end_write at the end of a download
2011-03-11 17:56:41 -03:00
Werner Almesberger
2978afe92b atusb/fw/flash.c: simplified logic of flash_write and corrected several small bugs
- flash.c (flash_write): we don't use eeprom_busy_wait, removed it
- flash.c (flash_write): write the page only at one place
- flash.c (flash_write): corrected the address of the page write
- flash.c (flash_write): value being added to word wasn't shifted
2011-03-11 17:56:41 -03:00
Werner Almesberger
553c981551 atusb/fw/flash.c: implemented flash_can_write and flash_read (were stubs) 2011-03-11 17:56:41 -03:00
Werner Almesberger
f87bdce41f atusb/fw/Makefile: added auxiliary Flash programming target (for development)
- Makefile (prog-app): flash the application, without the boot loader
- Makefile (prog-read): retrieve the Flash content
2011-03-11 16:24:49 -03:00
Werner Almesberger
e29046d19b atusb/fw/Makefile (prog): corrected boot loader size in hfuse 2011-03-11 16:23:42 -03:00
Werner Almesberger
edfb8a94eb atusb/fw/Makefile: clean up handing of boot loader base address
- Makefile (BOOT_ADDR, boot.elf): use variable instead of hiding the
  address in a command
- Makefile (CFLAGS): pass BOOT_ADDR as a macro
- Makefile: removed commented-out application flashing code
2011-03-11 16:21:39 -03:00
Werner Almesberger
b5fd6e3132 atusb/fw/Makefile: lock fuse refuses 0xef; set it to 0x2f to pass verification 2011-03-09 03:11:15 -03:00
Werner Almesberger
b8fc1a7f54 atusb/fw/flash.c: added basic writing support (untested) 2011-03-09 02:02:05 -03:00
Werner Almesberger
1dcc83391e atusb/fw/Makefile: put -mmcu into CFLAGS so that DEPEND uses it, too
- Makefile ($(NAME).elf, boot.elf, %.o): don't pass -mmcu explicitly
- Makefile (CFLAGS): include -mmcu, so that it's also picked up by
  $(DEPEND)
2011-03-09 01:45:35 -03:00
Werner Almesberger
6ac82fc6c9 atusb/fw/README: avr-libc 1.17.1 has been released 2011-03-09 01:36:18 -03:00
Werner Almesberger
341b348ac0 atusb/fw/Makefile (clean): also remove the boot loader 2011-03-09 00:57:01 -03:00
Werner Almesberger
e8bed1f3c1 atusb/fw/: flash a boot loader instead of the application (in progress)
- boot.c: basic boot loader that runs DFU for 2 s, then starts the payload
- board.h (DFU_USB_VENDOR, DFU_USB_PRODUCT): added USB IDs for DFU
- flash.c: stubs for board-specific Flash functions
- Makefile: build boot.hex for the boot loader
- Makefile (prog): load the boot loader at its rightful place
- Makefile (prog): also set hfuse and the lock fuse
2011-03-09 00:41:32 -03:00
Werner Almesberger
f91738c306 atusb/fw/usb/: adapted DFU engine to current stack and abstracted Flash ops
- dfu.c: updated includes
- dfu.c (device_descriptor): renamed USB IDs from USB_VENDOR/PRODUCT to
  DFU_USB_VENDOR/PRODUCT to allow differentiation
- dfu.c: changed all __bit to "int"
- dfu.c: removed all __xdata and __reentrant
- dfu.c: changed "ep0" to "eps[0]"
- dfu.c (payload, flash_erase_page, flash_write_byte, block_write,
  block_receive, block_transmit, my_setup): abstracted Flash interface
  and removed target-specific operations
- dfu.h: added prototypes for target-specific Flash operations
- dfu,c (my_setup, my_descr): removed SDCC-specific hacks
- dfu.c (my_reset): commented out - did we actually use this ?
2011-03-08 19:10:58 -03:00